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

:root {
  --green-900: #1B4332;
  --green-700: #2D6A4F;
  --green-500: #40916C;
  --green-200: #B7E4C7;
  --green-100: #D8F3DC;
  --green-50: #F0FAF1;
  --cream: #FFFBEB;
  --white: #FFFFFF;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--green-50);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  color: var(--green-900);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.75rem;
}

a {
  color: var(--green-700);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--green-500);
  text-decoration: underline;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--green-200);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--green-900);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--green-700);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--gray-600);
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--green-700);
  text-decoration: none;
}

/* ===== Hero Section ===== */
.hero {
  padding: 2.5rem 0 3rem;
  background: linear-gradient(180deg, var(--white) 0%, var(--green-50) 100%);
}

.hero .container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-text {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
}

/* ===== Calculator Card ===== */
.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--green-200);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--green-900);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.3rem;
}

.form-group input {
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--gray-100);
}

.form-group input:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
  background: var(--white);
}

.hint {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.2rem;
}

.btn-calculate {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--green-700);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 0.5rem;
  font-family: var(--font-sans);
}

.btn-calculate:hover {
  background: var(--green-500);
}

.btn-calculate:active {
  transform: scale(0.98);
}

/* ===== Result Panel ===== */
.result-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--green-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--green-200);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.95rem;
  text-align: center;
}

.result-active {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--green-900);
  width: 100%;
}

.result-active .result-line {
  font-size: 1rem;
  font-weight: 500;
}

.result-active .result-highlight {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-700);
}

.result-active .result-warning {
  font-size: 0.85rem;
  color: #B45309;
  background: #FEF3C7;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

/* ===== Info Section ===== */
.info-section {
  padding: 3rem 0;
  background: var(--white);
}

.info-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

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

.info-card {
  background: var(--green-50);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--green-200);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.info-icon {
  margin-bottom: 0.75rem;
  display: inline-block;
}

.info-card h3 {
  margin-bottom: 0.5rem;
}

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

/* ===== Reference Section ===== */
.reference-section {
  padding: 3rem 0;
  background: var(--green-50);
}

.reference-section h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-intro {
  text-align: center;
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
  min-width: 500px;
}

.reference-table th {
  background: var(--green-700);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.reference-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
}

.reference-table tbody tr:hover {
  background: var(--green-50);
}

.reference-note {
  text-align: center;
  background: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--green-200);
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--green-900);
  color: var(--green-100);
  padding: 1.5rem 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

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

.footer-nav a {
  color: var(--green-200);
  font-weight: 500;
}

.footer-nav a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .hero {
    padding: 1.5rem 0 2rem;
  }

  .calculator-card {
    padding: 1.25rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-group {
    min-width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .calculator-card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .btn-calculate {
    font-size: 1rem;
  }

  .reference-table {
    font-size: 0.8rem;
  }
}



/* 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;
}

.site-utility-links {
  width: min(900px, calc(100% - 32px));
  margin: 32px auto;
  padding-top: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(127, 127, 127, 0.25);
  font-size: 0.9rem;
}

.site-utility-links a {
  color: inherit;
  opacity: 0.75;
}
