﻿
/* ===================== PERFORMANCE / CLS ===================== */
/* Reserve viewport space for the SPA content before JavaScript renders it. */
#app {
  min-height: 100vh;
}
/* Optimized Font-Display to prevent layout shifts and render blocking */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

@font-face {
  font-family: 'Inter';
  src: local('Inter'), local('Inter-Regular');
  font-display: swap;
}

/* Prevent layout shifts for FontAwesome icons */
.fa, .fas, .far, .fab {
  display: inline-block;
  min-width: 1em;
  text-align: center;
}

/* Ad slots setup */
.ad-banner-container,
.ad-slot {
  min-height: 250px;
  width: 100%;
  display: block;
  background: var(--bg-soft);
}

img {
  max-width: 100%;
  height: auto;
  aspect-ratio: attr(width) / attr(height); 
}

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --secondary: #f59e0b;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --max-width: 1200px;
  --header-height: 64px;
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav a:hover, .nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.header-search {
  position: relative;
}

.header-search input {
  width: 220px;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  background: var(--bg-soft);
  transition: all 0.2s;
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  width: 280px;
  background: var(--bg);
}

.header-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text);
  cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 99;
  padding: 24px;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.mobile-menu a:hover, .mobile-menu a.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 24px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto 20px;
}

.hero-search input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 1rem;
  background: var(--bg);
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

.hero-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.hero-search i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-popular {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-popular a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.hero-popular a:hover {
  text-decoration: underline;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-soft);
}

.search-result-item i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  font-size: 0.875rem;
}

.search-result-item .sr-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.search-result-item .sr-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Featured Cards */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.calc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.calc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.calc-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.calc-card-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.calc-card-content p {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.category-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
}

.category-card-title {
  flex: 1;
}

.category-card-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.category-card-title p {
  font-size: 0.8rem;
  color: var(--text-light);
}

.category-card-arrow {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.category-card:hover .category-card-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-tag {
  padding: 4px 10px;
  background: var(--bg-soft);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Popular & Recent */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.popular-list, .recent-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.popular-item:hover {
  background: var(--bg-soft);
  border-color: var(--border);
}

.popular-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--text-light);
  flex-shrink: 0;
}

.popular-item:nth-child(1) .popular-rank {
  background: #fef3c7;
  color: #d97706;
}

.popular-item:nth-child(2) .popular-rank {
  background: #f3f4f6;
  color: var(--text);
}

.popular-item:nth-child(3) .popular-rank {
  background: #fef2f2;
  color: #dc2626;
}

.popular-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.popular-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
}

.popular-arrow {
  color: var(--text-muted);
}

.recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
}

.recent-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.recent-item i {
  color: var(--primary);
  font-size: 0.75rem;
}

/* Blog Cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.blog-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.blog-card-image {
  height: 160px;
  background: linear-gradient(135deg, var(--primary-light), #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.blog-card-content {
  padding: 20px;
}

.blog-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.blog-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.blog-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* FAQ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.faq-question {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.faq-question:hover {
  background: var(--bg-soft);
}

.faq-question i {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.faq-item.open .faq-question i {
  transform: rotate(90deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer-inner {
  padding: 0 20px 16px;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand p {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 4px 0;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* Page Content */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  min-height: 60vh;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Category Page */
.category-hero {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.category-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
  flex-shrink: 0;
}

.category-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.category-hero p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.calcs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Calculator Page */
.calc-page {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

.calc-main {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.calc-main h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.calc-main .calc-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn {
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.calc-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.calc-result {
  margin-top: 24px;
  padding: 24px;
  background: var(--primary-light);
  border-radius: var(--radius);
  border: 1px solid #99f6e4;
}

.calc-result.hidden {
  display: none;
}

.calc-result h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.calc-result-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.calc-result-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #99f6e4;
  font-size: 0.85rem;
  color: var(--text-light);
}

.calc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.sidebar-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.sidebar-card a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  transition: color 0.15s;
}

.sidebar-card a:last-child {
  border-bottom: none;
}

.sidebar-card a:hover {
  color: var(--primary);
}

.sidebar-card a i {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sidebar-ad {
  height: 250px;
}

/* Explanation Section */
.explanation {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.explanation h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.explanation p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.formula-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--primary-dark);
  margin: 12px 0;
  line-height: 1.6;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.related-item:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Blog Page */
.blog-hero {
  text-align: center;
  padding: 40px 24px;
}

.blog-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.blog-hero p {
  color: var(--text-light);
}

/* About / Contact */
.content-page {
  max-width: 720px;
  margin: 0 auto;
}

.content-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.content-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 24px 0 12px;
}

.content-page p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 16px;
}

.content-page strong {
  color: var(--text);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

/* Amortization Table */
.amort-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.85rem;
}

.amort-table th, .amort-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.amort-table th {
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg-soft);
}

.amort-table tr:hover {
  background: var(--bg-soft);
}

.table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}

/* Chart container */
.chart-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.chart-container canvas {
  max-height: 300px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-btn { display: block; }
  .header-search { display: none; }

  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 40px 20px 32px; }

  .category-grid { grid-template-columns: 1fr; }
  .split-section { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  .calc-page { grid-template-columns: 1fr; }
  .calc-sidebar { display: none; }

  .form-row { grid-template-columns: 1fr; }

  .section { padding: 32px 20px; }

  .sticky-mobile-ad { display: flex; }
  body { padding-bottom: 60px; }
}

@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .result-card, 
  [class*="result"], 
  .bg-card,
  div[class*="bg-"] {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  table, .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Utility classes */
.text-center { text-align: center; }
.mt-8 { margin-top: 32px; }
.mb-8 { margin-bottom: 32px; }
