/* ==========================================================================
   CALCUSERVE (calcuserve.com) - GLOBAL STYLESHEET
   Pure Vanilla CSS: Dark/Light Mode, Vibrant Multi-Color Buttons, Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS RESET & VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Light Theme Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #6366f1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  
  --ad-border: #cbd5e1;
  --ad-bg: #f8fafc;
  --ad-text: #64748b;

  /* Multi-color Gradient Presets */
  --grad-rainbow: linear-gradient(135deg, #ef4444 0%, #f59e0b 25%, #10b981 50%, #06b6d4 75%, #8b5cf6 100%);
  --grad-financial: linear-gradient(135deg, #10b981 0%, #059669 40%, #0284c7 100%);
  --grad-health: linear-gradient(135deg, #ec4899 0%, #f43f5e 40%, #8b5cf6 100%);
  --grad-math: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #d946ef 100%);
  --grad-time: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 40%, #10b981 100%);
  --grad-accent: linear-gradient(135deg, #ff007a 0%, #7928ca 50%, #0070f3 100%);
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: #151d2f;
  --bg-card-hover: #1b253b;
  --bg-input: #111827;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border-color: #1e293b;
  --border-hover: #334155;
  --border-focus: #818cf8;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: #1e1b4b;
  
  --ad-border: #334155;
  --ad-bg: #111827;
  --ad-text: #94a3b8;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY & UTILITIES
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.45rem); }

p {
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. MULTI-COLOR TEXT & BUTTON STYLES (REQUIRED)
   -------------------------------------------------------------------------- */
.multicolor-text {
  background: var(--grad-rainbow);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: rainbowFlow 6s linear infinite;
}

@keyframes rainbowFlow {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

.multicolor-text-accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.btn-vibrant {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  background-color: var(--bg-card);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
  z-index: 1;
}

.btn-vibrant::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--grad-rainbow);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.btn-vibrant:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 20px rgba(99, 102, 241, 0.25);
}

.btn-vibrant:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-vibrant .btn-title {
  background: var(--grad-rainbow);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Category-specific vibrant card buttons */
.category-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  text-decoration: none !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-card-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--category-gradient, var(--grad-rainbow));
}

.category-card-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2), 0 0 25px rgba(99, 102, 241, 0.15);
  border-color: var(--border-focus);
}

.category-card-btn .cat-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  background: var(--cat-badge-bg, var(--primary-light));
  color: var(--cat-badge-color, var(--primary));
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.category-card-btn:hover .cat-icon-badge {
  transform: scale(1.1) rotate(4deg);
}

.category-card-btn .cat-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  background: var(--category-gradient, var(--grad-rainbow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
}

.category-card-btn .cat-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.category-card-btn .cat-action {
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  transition: gap 0.2s ease;
}

.category-card-btn:hover .cat-action {
  gap: 0.75rem;
}

/* Category Specific Color Schemes */
.cat-financial {
  --category-gradient: var(--grad-financial);
  --cat-badge-bg: rgba(16, 185, 129, 0.12);
  --cat-badge-color: #10b981;
}

.cat-health {
  --category-gradient: var(--grad-health);
  --cat-badge-bg: rgba(236, 72, 153, 0.12);
  --cat-badge-color: #ec4899;
}

.cat-math {
  --category-gradient: var(--grad-math);
  --cat-badge-bg: rgba(99, 102, 241, 0.12);
  --cat-badge-color: #6366f1;
}

.cat-time {
  --category-gradient: var(--grad-time);
  --cat-badge-bg: rgba(14, 165, 233, 0.12);
  --cat-badge-color: #0ea5e9;
}

/* Tool Buttons inside Category Listing */
.tool-card-btn {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tool-card-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.tool-card-btn .tool-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tool-card-btn .tool-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

.tool-card-btn .tool-title {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--category-gradient, var(--grad-rainbow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-card-btn .tool-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.tool-card-btn .tool-arrow {
  align-self: flex-end;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   4. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-rainbow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--grad-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none !important;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--bg-tertiary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

.theme-toggle-btn:hover {
  background-color: var(--border-hover);
  transform: rotate(15deg);
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   5. HERO SECTION (HOMEPAGE)
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding: 4rem 1.25rem 3.5rem;
  background: radial-gradient(circle at 50% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
}

/* Floating Animated Math & Calculator Icons */
.hero-floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-icon {
  position: absolute;
  opacity: 0.22;
  font-size: 2.2rem;
  animation: floatAnim 10s ease-in-out infinite;
  user-select: none;
}

.floating-icon:nth-child(1) { top: 15%; left: 8%; animation-duration: 9s; animation-delay: 0s; }
.floating-icon:nth-child(2) { top: 65%; left: 12%; animation-duration: 11s; animation-delay: 2s; }
.floating-icon:nth-child(3) { top: 20%; right: 10%; animation-duration: 8s; animation-delay: 1s; }
.floating-icon:nth-child(4) { top: 70%; right: 14%; animation-duration: 12s; animation-delay: 3s; }
.floating-icon:nth-child(5) { top: 40%; left: 4%; animation-duration: 13s; animation-delay: 1.5s; }
.floating-icon:nth-child(6) { top: 45%; right: 5%; animation-duration: 10s; animation-delay: 2.5s; }

@keyframes floatAnim {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(12deg); }
}

/* --------------------------------------------------------------------------
   6. MONETIZATION & ADSENSE CONTAINERS (STRICT 728x90)
   -------------------------------------------------------------------------- */
.adsense-placeholder-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  overflow: hidden;
}

.adsense-placeholder {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 20px auto;
  overflow: hidden;
  background-color: var(--ad-bg);
  border: 2px dashed var(--ad-border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  transform-origin: top center;
  transition: border-color 0.2s ease;
}

.adsense-placeholder:hover {
  border-color: var(--primary);
}

.adsense-placeholder .ad-tag {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ad-text);
  font-weight: 700;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.adsense-placeholder .ad-size {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.adsense-placeholder .ad-note {
  font-size: 0.72rem;
  color: var(--ad-text);
}

@media (max-width: 768px) {
  .adsense-placeholder {
    transform: scale(0.45);
    height: 40px;
    margin: 10px auto;
  }
}

/* --------------------------------------------------------------------------
   7. LAYOUTS: CATEGORIES & TOOLS
   -------------------------------------------------------------------------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.75rem;
  margin: 2.5rem 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Category Page Intro */
.category-header {
  padding: 3rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.category-header .cat-header-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

/* Cross-promotion: Explore Other Categories */
.explore-others-section {
  margin: 3.5rem 0 2rem;
  padding: 2.5rem 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.explore-others-section h3 {
  margin-bottom: 0.5rem;
}

.explore-others-section p {
  margin-bottom: 1.5rem;
}

.other-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.other-cat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.other-cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.other-cat-card .icon {
  font-size: 1.6rem;
}

.other-cat-card .title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   8. CALCULATOR PAGE INTERACTIVE UI
   -------------------------------------------------------------------------- */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.calc-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-group .input-wrapper .prefix,
.form-group .input-wrapper .suffix {
  position: absolute;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.form-group .input-wrapper .prefix { left: 0.85rem; }
.form-group .input-wrapper .suffix { right: 0.85rem; }

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.has-prefix { padding-left: 2rem; }
.has-suffix { padding-right: 2.25rem; }

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

select.form-control {
  cursor: pointer;
  appearance: auto;
}

.calc-btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.calc-btn {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary-calc {
  background: var(--grad-rainbow);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-primary-calc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary-calc {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary-calc:hover {
  background: var(--border-hover);
  color: var(--text-primary);
}

/* Calculator Result Panel */
.calc-result-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.calc-result-panel h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-hero-value {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.breakdown-item {
  display: flex;
  flex-direction: column;
}

.breakdown-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breakdown-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Keypad Styles for Scientific / Simple Calculator */
.calc-display {
  width: 100%;
  padding: 1.25rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 1.8rem;
  text-align: right;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  min-height: 70px;
  word-break: break-all;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.keypad-grid.scientific-keys {
  grid-template-columns: repeat(5, 1fr);
}

.key-btn {
  padding: 1rem 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.key-btn:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.key-btn.key-op {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.key-btn.key-equal {
  background: var(--grad-rainbow);
  color: #fff;
  font-weight: 800;
  grid-column: span 2;
}

/* --------------------------------------------------------------------------
   9. EDITORIAL / EDUCATIONAL CONTENT (AdSense Anti-Thin-Content)
   -------------------------------------------------------------------------- */
.editorial-content-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-sm);
}

.editorial-content-section h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.editorial-content-section h2:first-child {
  margin-top: 0;
}

.editorial-content-section h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.editorial-content-section p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.editorial-content-section ul, 
.editorial-content-section ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.editorial-content-section li {
  margin-bottom: 0.5rem;
}

.formula-box {
  background: var(--bg-tertiary);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-primary);
  overflow-x: auto;
}

.faq-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.faq-card h4 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
}

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

.breadcrumbs .sep {
  color: var(--border-hover);
}

/* --------------------------------------------------------------------------
   10. LEGAL & INFORMATION PAGES (About, Contact, Privacy, etc.)
   -------------------------------------------------------------------------- */
.legal-page-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-sm);
}

.legal-page-card h1 {
  margin-bottom: 0.75rem;
}

.legal-page-card .last-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.legal-page-card h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-page-card h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-page-card p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 650px;
  margin-top: 1.5rem;
}

.contact-alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: none;
}

.contact-alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* --------------------------------------------------------------------------
   11. HTML SITEMAP PAGE
   -------------------------------------------------------------------------- */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.sitemap-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.sitemap-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sitemap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sitemap-list li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sitemap-list li a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   12. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.25rem 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  margin-top: 1rem;
  max-width: 340px;
  font-size: 0.95rem;
}

.footer-col h4 {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   13. RESPONSIVE DESIGN (MOBILE & TABLET)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle-btn {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .legal-page-card,
  .editorial-content-section,
  .calculator-card {
    padding: 1.5rem;
  }
}
