/* ==========================================================================
   DECIMAL & FRACTION CALCULATOR - MAIN STYLESHEET
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Color System
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette - Professional Mathematical Precision */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #f0fdf4;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 2px 0 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: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  --container-max: 1200px;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: #1e3a8a;

  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-light: rgba(20, 184, 166, 0.15);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;

  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-subtle: #334155;
  --bg-input: #0f172a;

  --border-color: #334155;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   2. Resets & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

a:hover {
  text-decoration: underline;
}

img, svg {
  vertical-align: middle;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Layout Utilities & Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section-padding {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* --------------------------------------------------------------------------
   4. Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

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

.brand-logo:hover {
  text-decoration: none;
}

.brand-icon,
.brand-logo-img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.brand-icon {
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-name-accent {
  color: var(--primary);
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.1rem;
    gap: 0.4rem;
  }
  .brand-icon,
  .brand-logo-img {
    width: 2rem;
    height: 2rem;
  }
  .header-actions {
    gap: 0.5rem;
  }
  .theme-toggle-btn,
  .mobile-menu-btn {
    width: 2.25rem;
    height: 2.25rem;
  }
}

.desktop-nav {
  display: none;
}

@media (min-width: 900px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  text-decoration: none;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

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

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

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

.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

@media (min-width: 900px) {
  .mobile-menu-btn {
    display: none;
  }
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  display: none;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem 1.5rem;
}

.mobile-nav-drawer.open {
  display: block;
}

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

.mobile-nav-list .nav-link {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
}

.mobile-nav-list .nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.mobile-nav-list .nav-link.active::after {
  display: none;
}

/* --------------------------------------------------------------------------
   5. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb-nav {
  padding-top: 1.25rem;
  font-size: 0.875rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  color: var(--text-light);
  flex-wrap: wrap;
}

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

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

.breadcrumb-separator {
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   6. Hero Section (Clean 2-Column Professional Layout)
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: left;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3.5rem;
    align-items: stretch;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}


.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  border: 1px solid var(--primary-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 0.875rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

.hero-desc-p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.hero-desc-p:last-of-type {
  margin-bottom: 1.5rem;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.hero-cta-group .btn {
  flex: 0 0 auto;
  padding: 0.75rem 1.5rem;
  font-size: 0.975rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-cta-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  .hero-cta-group .btn-secondary {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-tags-row {
    gap: 0.5rem 0.875rem;
  }
}

.hero-cta-group .btn:hover,
.hero-cta-group .btn:focus {
  text-decoration: none;
}

.hero-cta-group .btn svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.hero-cta-group .btn-secondary {
  flex: 0 0 auto;
  padding-left: 1.75rem;
  padding-right: 1.75rem;
  white-space: nowrap;
}

.hero-cta-group .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  text-decoration: none;
}

.hero-cta-group .btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.hero-tags-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0;
}

.hero-tag-pill svg {
  color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.hero-illustration-col {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hero-img {
  width: 100%;
  max-width: 18rem;
  height: auto;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: none;
  background: transparent;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

@media (min-width: 900px) {
  .hero-illustration-col {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-img {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }
}

.hero-img:hover {
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   7. Calculator Main Interface Components
   -------------------------------------------------------------------------- */
.calculator-container {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
}

.calculator-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

[data-theme="dark"] .calculator-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.calculator-card::before {
  content: "";
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.calculator-tabs {
  display: flex;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 0.375rem 0.375rem 0;
  gap: 0.375rem;
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--primary);
  background-color: rgba(37, 99, 235, 0.06);
}

.tab-btn.active {
  color: var(--primary);
  background-color: var(--bg-card);
  border-color: var(--border-color);
  border-bottom-color: var(--bg-card);
  font-weight: 700;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.02);
  margin-bottom: -1px;
}

.tab-btn svg {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.tab-btn:hover svg {
  transform: scale(1.1);
}

.calculator-body {
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .calculator-body {
    padding: 2.25rem;
  }
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: 0.375rem;
  line-height: 1.4;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  box-shadow: none;
}

.input-field:hover {
  border-color: #cbd5e1;
}

[data-theme="dark"] .input-field:hover {
  border-color: #475569;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
  background-color: var(--bg-card);
}

/* Fraction Dual-Input Group Layout */
.fraction-input-grid {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 14rem;
}

.fraction-inputs-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
  width: 100%;
}

.fraction-inputs-vertical:focus-within {
  border-color: var(--primary);
}

.fraction-inputs-vertical .input-field {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.5rem 0.75rem;
}

.fraction-bar-divider {
  height: 2px;
  background-color: var(--primary);
  width: 100%;
  border-radius: 2px;
  opacity: 0.85;
}

.mixed-input-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.875rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.whole-number-input {
  width: 5.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.75rem 0.5rem;
}

/* Repeating Decimal Fields Grid */
.repeating-decimal-grid {
  display: flex;
  gap: 0.625rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 0.875rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Operations Selector for Fraction Calculator */
.operation-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  padding: 0.375rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.op-btn {
  padding: 0.75rem 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.op-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

.op-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.fraction-ops-container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.25rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.op-display-badge {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--bg-card);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Action Buttons Container */
.btn-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .calculator-body {
    padding: 1.25rem 1rem;
  }
  .fraction-ops-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
  }
  .mixed-input-wrapper {
    justify-content: center;
    width: 100%;
    padding: 0.75rem 0.625rem;
  }
}

@media (max-width: 480px) {
  .calculator-tabs {
    padding: 0.25rem 0.25rem 0;
    gap: 0.25rem;
  }
  .tab-btn {
    padding: 0.65rem 0.35rem;
    font-size: 0.85rem;
    gap: 0.35rem;
  }
  .tab-btn svg {
    width: 16px;
    height: 16px;
  }
  .repeating-decimal-grid {
    padding: 0.625rem;
    gap: 0.375rem;
  }
  .repeating-decimal-grid > div {
    min-width: 0 !important;
    flex: 1 1 30% !important;
  }
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-group .btn {
    width: 100%;
    flex: 1 1 100%;
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  line-height: 1.25;
  text-decoration: none;
}

.btn:hover,
.btn:focus,
.btn:active {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  flex: 2;
  min-width: 10rem;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--bg-subtle);
  border-color: var(--border-color);
  color: var(--text-muted);
  flex: 1;
}

.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-main);
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* Example Quick Buttons */
.example-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

.pill-label {
  font-size: 0.8125rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-btn {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.3125rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

/* Inline Error Message Box */
.error-box {
  display: none;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

[data-theme="dark"] .error-box {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: #991b1b;
  color: #fca5a5;
}

.error-box.show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   8. Results & Calculation Output Card
   -------------------------------------------------------------------------- */
.results-container {
  display: none;
  margin-top: 2rem;
  border-top: 2px solid var(--border-color);
  padding-top: 1.75rem;
  animation: fadeIn 0.3s ease-out;
}

.results-container.show {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-main-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(37, 99, 235, 0.03) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.05);
}

.result-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.result-title-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--primary);
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.copy-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.result-primary-val {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: break-word;
}

.result-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .result-main-card {
    padding: 1rem;
  }
  .result-primary-val {
    font-size: 1.85rem;
  }
  .result-secondary-grid {
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 0.5rem;
  }
  .res-item-box {
    padding: 0.75rem 0.5rem;
  }
  .steps-container {
    padding: 1rem 0.875rem;
  }
  .step-item {
    padding-left: 2rem;
    font-size: 0.875rem;
  }
}

.res-item-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.875rem 0.75rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.res-item-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.375rem;
}

.res-item-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Step-By-Step Instructions Container */
.steps-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.steps-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.625rem;
}

.steps-title svg {
  color: var(--primary);
}

.step-list {
  list-style-type: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 0;
}

.step-item {
  position: relative;
  padding-left: 2.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.5rem;
  height: 1.5rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-item strong {
  color: var(--text-main);
}

.math-code {
  font-family: var(--font-mono);
  background-color: var(--bg-subtle);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

/* --------------------------------------------------------------------------
   9. Educational Content Sections
   -------------------------------------------------------------------------- */
.content-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-card) 100%);
}

.prose {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.prose h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.3;
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
  flex-shrink: 0;
}

.prose h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  color: var(--text-main);
  letter-spacing: -0.015em;
}

.prose p {
  margin-bottom: 1.35rem;
  color: var(--text-muted);
  line-height: 1.75;
  font-size: 1.025rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
  font-size: 1.025rem;
  line-height: 1.7;
}

.prose li {
  margin-bottom: 0.625rem;
}

.prose li strong {
  color: var(--text-main);
}

.callout-box {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.04);
  position: relative;
}

.callout-box p {
  margin-bottom: 0.5rem;
  color: var(--text-main);
  line-height: 1.6;
}

.callout-box p:last-child {
  margin-bottom: 0;
}

.callout-box strong {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Guide Cards & Conversion Sections
   -------------------------------------------------------------------------- */
.guide-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .guide-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.guide-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.guide-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-card-title {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: var(--text-main) !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.3 !important;
}

.guide-card-title::before {
  display: none !important;
}

/* Single Column Layout for Steps and Category Cards */
.guide-steps-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.guide-step-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.guide-step-card:hover {
  border-color: var(--primary-border);
  background-color: var(--bg-card);
  transform: translateX(4px);
}

@media (max-width: 480px) {
  .guide-card {
    padding: 1.25rem 1rem;
  }
  .guide-card-header {
    gap: 0.75rem;
  }
  .guide-card-icon {
    width: 2.25rem;
    height: 2.25rem;
  }
  .guide-card-title {
    font-size: 1.25rem !important;
  }
  .guide-step-card {
    padding: 1rem 0.875rem;
    gap: 0.75rem;
  }
  .guide-step-num {
    min-width: 1.85rem;
    height: 1.85rem;
    font-size: 0.8125rem;
    padding: 0 0.5rem;
  }
}

.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
  white-space: nowrap;
}

.guide-step-content {
  flex: 1;
}

.guide-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}

.guide-step-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Example Box inside Guide Cards */
.guide-example-box {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
}

.guide-example-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.guide-example-body {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Decimal Type Cards Single Column Grid */
.decimal-types-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.decimal-type-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.decimal-type-card:hover {
  border-color: var(--accent);
  background-color: var(--bg-card);
  transform: translateX(4px);
}

.decimal-type-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background-color: var(--accent-light);
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  margin-bottom: 0.625rem;
}

.decimal-type-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.decimal-type-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   10. Reference Tables
   -------------------------------------------------------------------------- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .data-table th,
  .data-table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
  }
}

.data-table th {
  background-color: var(--bg-subtle);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   11. FAQ Section (Accordion)
   -------------------------------------------------------------------------- */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.75rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.faq-item:hover {
  border-color: var(--primary-border);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.05);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.faq-question:hover {
  color: var(--primary);
  background-color: rgba(37, 99, 235, 0.03);
}

.faq-icon {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition-fast);
  color: var(--text-light);
  flex-shrink: 0;
  display: block;
}

.faq-item.open {
  border-color: var(--primary);
}

.faq-item.open .faq-question {
  color: var(--primary);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  border-top: 1px dashed var(--border-color);
  margin-top: -0.25rem;
  padding-top: 1rem;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --------------------------------------------------------------------------
   12. Related Calculators Section
   -------------------------------------------------------------------------- */
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.related-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.related-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background-color var(--transition-fast);
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  border-color: var(--primary-border);
  text-decoration: none;
}

.related-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.related-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.related-card-title svg {
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.related-card:hover .related-card-title svg {
  transform: translateX(4px);
}

.related-card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.related-card-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: gap var(--transition-fast);
}

.related-card:hover .related-card-link {
  gap: 0.625rem;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding-top: 3.5rem;
  padding-bottom: 2.5rem;
  margin-top: 4.5rem;
}

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

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.footer-brand-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-logo-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.footer-brand-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 22rem;
}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.925rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: inline-block;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   14. Toast Feedback Notification
   -------------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--text-main);
  color: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   15. Accessibility & Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   16. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .breadcrumb-nav,
  .theme-toggle-btn,
  .mobile-menu-btn,
  .btn-group,
  .example-pills,
  .copy-btn,
  .related-grid {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .calculator-card,
  .result-main-card,
  .steps-container {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}

/* --------------------------------------------------------------------------
   17. About, Contact & Legal Component Utilities (Single Column & Mobile Responsive)
   -------------------------------------------------------------------------- */

/* Max-width single column container for content prose pages */
.content-section .container.prose,
.contact-prose-container {
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .content-section .container.prose,
  .contact-prose-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Feature Showcase Grid - Single Column */
.feature-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .feature-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
  }
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.feature-icon-wrapper {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon-wrapper svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feature-card-content {
  flex: 1;
}

.feature-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  line-height: 1.3;
}

.feature-card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* User Persona / Target Audience - Single Column */
.persona-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}

.persona-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.persona-card:hover {
  box-shadow: var(--shadow-sm);
  border-left-color: var(--accent);
}

.persona-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.persona-card h3 svg {
  color: var(--primary);
  flex-shrink: 0;
}

.persona-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Technical Deep Dive Box - Single Column */
.tech-explanation-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .tech-explanation-box {
    padding: 1.75rem;
  }
}

.tech-explanation-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.tech-code-snippet {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--primary);
  margin: 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Contact Info / Email Cards - Enhanced Single Column */
.contact-info-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
}

.contact-info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .contact-info-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.contact-info-card:hover {
  border-color: var(--primary-border);
  border-left-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-info-header-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing text */
}

.contact-info-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-light), var(--bg-subtle));
  color: var(--primary);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.contact-info-content {
  flex: 1;
  min-width: 0; /* Ensures child text wrap works */
}

.contact-info-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.contact-info-detail {
  font-size: 0.9375rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-info-detail a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-info-detail a:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.contact-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none !important;
  align-self: flex-start;
}

@media (min-width: 640px) {
  .contact-action-btn {
    align-self: center;
  }
}

.contact-action-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* FAQ Section - Reliable Click-to-Expand Accordion Component */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 50rem;
  margin: 2rem auto;
}

.faq-accordion-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.faq-accordion-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.faq-accordion-card.is-open {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.faq-accordion-btn {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
}

.faq-accordion-card.is-open .faq-accordion-btn {
  background-color: var(--primary-light);
  border-bottom: 1px solid var(--border-color);
}

.faq-question-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.faq-q-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-weight: 800;
  font-size: 0.8125rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.faq-accordion-card.is-open .faq-q-badge {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.faq-chevron {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.faq-accordion-card.is-open .faq-chevron {
  transform: rotate(180deg);
}

.faq-accordion-answer {
  display: block !important;
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  background-color: var(--bg-card);
  border-top: 1px dashed var(--border-color);
}

.faq-accordion-card.is-open .faq-accordion-answer {
  display: block !important;
}

.faq-accordion-answer p {
  margin-bottom: 0.75rem;
}

.faq-accordion-answer p:last-child {
  margin-bottom: 0;
}

.faq-accordion-answer ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.faq-accordion-answer li {
  margin-bottom: 0.35rem;
}

/* Legal Table of Contents - Single Column Stack */
.legal-toc {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.legal-toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legal-toc-list a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0;
  min-height: 2.25rem;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.legal-toc-list a:hover {
  color: var(--primary-hover);
  transform: translateX(3px);
}

/* Cookie Table - Mobile Responsive Scroll */
.cookie-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.cookie-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}

.cookie-table th,
.cookie-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.cookie-table tr:last-child td {
  border-bottom: none;
}

.cookie-table th {
  background-color: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.cookie-table td {
  background-color: var(--bg-card);
  color: var(--text-muted);
}

/* Comprehensive Mobile Responsiveness Fixes */
@media (max-width: 768px) {
  .section-padding {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .hero-section {
    padding-top: 1.75rem !important;
    padding-bottom: 2rem !important;
  }

  .hero-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .hero-illustration-col {
    text-align: center;
  }

  .hero-img {
    max-width: 220px !important;
    height: auto !important;
    margin: 0 auto !important;
  }

  .hero-title {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
  }

  .hero-desc-p {
    font-size: 0.9375rem !important;
  }

  .hero-cta-group {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  .calculator-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .calculator-card {
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
  }

  .calculator-body {
    padding: 1.25rem 1rem !important;
  }

  .input-field,
  select.input-field,
  textarea.input-field {
    font-size: 16px !important; /* Prevents auto zoom on iOS */
    min-height: 48px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  textarea.input-field {
    min-height: 120px !important;
  }

  .contact-info-card {
    padding: 1.15rem 1rem !important;
  }

  .faq-card {
    padding: 1.15rem 1rem !important;
  }

  .faq-answer {
    padding-left: 0 !important;
  }
}



