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

:root {
  --bg: #f9f7fd;
  --surface: #ffffff;
  --primary: #5b4bca;
  --primary-light: #eae5ff;
  --text: #1e1b2e;
  --text-muted: #5c5776;
  --border: #e2ddf2;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(91, 75, 202, 0.06);
  --shadow-md: 0 8px 24px rgba(91, 75, 202, 0.1);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 30% 30%, rgba(91, 75, 202, 0.07), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

/* Ad slot placeholder */
body > .container > header + * {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--primary-light);
  padding: 0.35rem;
  border-radius: 40px;
  margin-bottom: 2rem;
}

.mode-btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Calculator Panel */
.calc-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.calc-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.hidden {
  display: none;
}

.date-field,
.number-field {
  flex: 1;
  min-width: 150px;
}

.date-field label,
.number-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.date-field input,
.number-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--bg);
  transition: border-color 0.2s;
}

.date-field input:focus,
.number-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 75, 202, 0.1);
}

.swap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.swap-icon:hover {
  transform: rotate(180deg);
}

.calc-btn {
  align-self: flex-start;
  padding: 0.8rem 2.2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.calc-btn:hover {
  background: #4a3db3;
}

.calc-btn:active {
  transform: scale(0.97);
}

/* Result Card */
.result-card {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f4f0ff, #fdfbff);
  border-radius: 14px;
  border: 1px solid var(--border);
  text-align: center;
}

.result-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.result-context {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* Info Section */
.info-section {
  margin-bottom: 2.5rem;
}

.info-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-card {
  background: var(--surface);
  padding: 1.4rem;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.info-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Streak Section */
.streak-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.streak-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.streak-section > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.streak-input {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.streak-input input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg);
  min-width: 170px;
}

.streak-btn {
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.streak-btn:hover {
  background: #4a3db3;
}

.streak-result {
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}

/* FAQ */
.faq-section {
  margin-bottom: 2.5rem;
}

.faq-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

details {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem 1.3rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

summary {
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::after {
  content: '▾';
  font-size: 0.9rem;
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: rotate(180deg);
}

details p {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  gap: 1.2rem;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1.2rem 1rem 2rem;
  }

  .logo h1 {
    font-size: 1.4rem;
  }

  .calc-panel {
    padding: 1.3rem;
  }

  .mode-btn {
    font-size: 0.8rem;
    padding: 0.55rem 0.4rem;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .swap-icon {
    align-self: center;
    transform: rotate(90deg);
  }

  .swap-icon:hover {
    transform: rotate(270deg);
  }

  .result-value {
    font-size: 1.7rem;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .container {
    padding: 1.8rem 1.5rem 2.5rem;
  }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}
