/* ==========================================================================
   GigaCalculator Offline Suite — Comprehensive Design System
   Vanilla CSS with Dark/Light Themes, Glassmorphism, Micro-interactions
   ========================================================================== */

:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-input: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo-group {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  transition: transform 0.25s ease;
}

.brand-logo:hover .logo-icon {
  transform: rotate(-6deg) scale(1.05);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-highlight {
  color: var(--accent-cyan);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-emerald);
  text-transform: uppercase;
}

/* Header Search Input */
.header-search-wrapper {
  flex: 1;
  max-width: 540px;
  position: relative;
}

.search-input-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.9rem;
  transition: all 0.2s ease;
}

.search-input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  margin-right: 0.5rem;
}

.search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.9rem;
}

.search-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.search-result-item:hover, .search-result-item.selected {
  background-color: var(--bg-card-hover);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.search-result-category {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  color: var(--text-muted);
}

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

/* Currency Picker */
.currency-picker-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  transition: all 0.2s ease;
}

.currency-picker-container:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-card-hover);
}

.currency-globe-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.currency-picker-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0.1rem 0.2rem;
}

.currency-picker-select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

/* Calculator Header Currency Badge */
.calc-currency-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.btn-action {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-action svg {
  width: 17px;
  height: 17px;
}

.badge-count {
  background-color: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Category Navigation Bar */
.category-nav {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.category-nav-scroll {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-nav-scroll::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}

.nav-tab.active {
  color: #fff;
  background-color: var(--primary);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 1.5rem 0 3rem;
}

.content-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

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

.breadcrumb-item.current {
  color: var(--text-main);
  font-weight: 600;
}

/* Page Views */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

/* ==========================================================================
   Hero Banner & Directory
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15)), var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  line-height: 1.5;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-badge-tag {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Tools Filter Bar */
.tools-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
}

.tools-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

.filter-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  outline: none;
}

.filter-input:focus {
  border-color: var(--border-focus);
}

/* Tools Grid - Compact & 3D Modern Aesthetic */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.9rem;
}

.tool-card {
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-bottom: 3px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 168px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 6px 12px -2px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .tool-card {
  background: linear-gradient(180deg, #1f293d 0%, #172033 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 3px solid rgba(0, 0, 0, 0.35);
  box-shadow: 
    0 3px 6px -1px rgba(0, 0, 0, 0.4),
    0 8px 16px -2px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 3D Top Highlight Sheen */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  opacity: 0;
  transition: opacity 0.22s ease;
}

/* 3D Lift & Elevation on Hover */
.tool-card:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: rgba(99, 102, 241, 0.45);
  border-bottom: 3px solid var(--primary);
  box-shadow: 
    0 10px 20px -3px rgba(99, 102, 241, 0.25),
    0 14px 28px -5px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 
    0 10px 22px -3px rgba(99, 102, 241, 0.35),
    0 16px 32px -4px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tool-card:hover::before {
  opacity: 1;
}

/* 3D Button Press on Click */
.tool-card:active {
  transform: translateY(-1px) scale(0.995);
  border-bottom-width: 2px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

/* 3D Embossed Icon Container */
.card-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-input));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover .card-icon {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.22);
}

.card-tag {
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background-color: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 0.93rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.1em;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 600;
}

.card-arrow {
  transition: transform 0.2s ease;
  font-size: 0.85rem;
}

.tool-card:hover .card-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Home Directory Layout with Modern 3D Right Sidebar
   ========================================================================== */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.home-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 75px;
  min-width: 0;
}

/* 3D Modern Sidebar Widget */
.modern-3d-widget {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-bottom: 3px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 6px 14px -2px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

[data-theme="dark"] .modern-3d-widget {
  background: linear-gradient(180deg, #1f293d 0%, #172033 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 3px solid rgba(0, 0, 0, 0.4);
  box-shadow: 
    0 3px 6px -1px rgba(0, 0, 0, 0.4),
    0 8px 16px -2px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.widget-header-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.widget-header-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.widget-icon {
  font-size: 1.1rem;
}

.widget-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.widget-badge.badge-green {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Top Used Calculators List */
.widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.top-used-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  background-color: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.top-used-item:hover {
  background-color: var(--bg-input);
  border-color: var(--border-color);
  transform: translateX(3px);
}

.top-used-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-input));
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.top-used-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-used-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.top-used-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.top-used-uses {
  color: var(--accent-amber);
  font-weight: 600;
  font-size: 0.68rem;
}

/* Category Sidebar List - No scrollbars, clean full display, strictly inside box */
.widget-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.widget-cat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 600;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.15s ease;
}

.widget-cat-item:hover, .widget-cat-item.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.widget-cat-item:hover .widget-cat-count, .widget-cat-item.active .widget-cat-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.widget-cat-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.widget-cat-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-cat-count {
  font-size: 0.62rem;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Visitor Region & Currency Card */
.sidebar-location-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.location-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 9px;
}

.location-country-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.location-flag {
  font-size: 1.2rem;
}

.location-currency-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
}

.location-detail-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.location-change-btn {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--primary);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.location-change-btn:hover {
  background-color: var(--bg-input);
  border-style: solid;
  border-color: var(--primary);
}

@media (max-width: 1080px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  .home-sidebar {
    position: static;
  }
}

/* ==========================================================================
   Calculator Detail Layout
   ========================================================================== */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

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

.calc-header-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.calc-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.calc-actions-top {
  display: flex;
  gap: 0.5rem;
}

.btn-icon-subtle {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-subtle:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-icon-subtle svg {
  width: 17px;
  height: 17px;
}

.calc-main-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.calc-main-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Calculator Interactive Form & Output */
.calc-body-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

/* Common Interactive Form Styles */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

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

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.input-with-addon {
  display: flex;
  align-items: stretch;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-addon:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-addon {
  padding: 0.6rem 0.85rem;
  background-color: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
}

.input-addon.addon-right {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.calc-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  width: 100%;
}

.calc-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.calc-select:focus {
  border-color: var(--border-focus);
}

/* Radio Button Group */
.radio-pill-group {
  display: flex;
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.25rem;
  border: 1px solid var(--border-color);
}

.radio-pill-item {
  flex: 1;
  text-align: center;
}

.radio-pill-item input {
  display: none;
}

.radio-pill-label {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-pill-item input:checked + .radio-pill-label {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

/* Result Box */
.calc-result-box {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  animation: fadeIn 0.3s ease-out;
}

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

.result-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.result-main-value {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
}

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

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

.result-item-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

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

/* Educational Panel (Formulas, Explanation, Examples) */
.calc-educational-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.accordion-tab {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.accordion-tab h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.formula-box {
  background-color: var(--bg-input);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-cyan);
  overflow-x: auto;
  line-height: 1.6;
}

.educational-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.educational-text p {
  margin-bottom: 0.75rem;
}

.educational-text ul, .educational-text ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.example-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Sidebar */
.calc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.sidebar-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.related-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.related-link-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.related-link-item:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
  transform: translateX(4px);
}

.scraper-notice-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
  border-color: rgba(16, 185, 129, 0.2);
}

.sidebar-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.sidebar-text-sm {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.sidebar-card code {
  display: inline-block;
  background-color: var(--bg-input);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-entry {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-tool-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-result {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-emerald);
  font-size: 0.95rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

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

.hidden {
  display: none !important;
}

/* ==========================================================================
   Special Calculator Specific Styles (Scientific, Height Compare, etc.)
   ========================================================================== */
/* Scientific Keypad */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.keypad-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.9rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.keypad-btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.keypad-btn.op-btn {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.keypad-btn.action-btn {
  background-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.keypad-btn.equal-btn {
  background: var(--primary);
  color: #fff;
  grid-column: span 2;
}

/* Height Comparison Stage */
.height-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2rem;
  height: 280px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
  position: relative;
}

.height-silhouette {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: height 0.3s ease;
}

.silhouette-body {
  width: 48px;
  background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
  border-radius: 24px 24px 4px 4px;
}

.silhouette-label {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* BMI Meter */
.bmi-meter-container {
  margin-top: 1.25rem;
}

.bmi-meter-bar {
  height: 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 25%, #facc15 65%, #f87171 100%);
  position: relative;
}

.bmi-marker {
  position: absolute;
  top: -6px;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bmi-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 1024px) {
  .calculator-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }
  .header-search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .calc-body-card {
    padding: 1.25rem;
  }
}

/* ==========================================================================
   Articles & Knowledge Hub Styles
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.article-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-lg);
  background-color: var(--bg-card-hover);
}

.article-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.article-cat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background-color: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.article-card-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.article-card-footer .card-arrow {
  color: var(--primary);
  font-weight: 600;
}

/* Article Reader View */
.article-reader-card {
  max-width: 860px;
  margin: 0 auto;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.article-reader-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.article-reader-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.article-reader-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-reader-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: var(--accent-cyan);
}

.article-reader-body p {
  margin-bottom: 1.25rem;
}

.article-reader-body ul, .article-reader-body ol {
  padding-left: 1.75rem;
  margin-bottom: 1.25rem;
}

.article-reader-body li {
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Scientific Calculator Keypad & Silhouettes
   ========================================================================== */
.scientific-keypad {
  max-width: 520px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.scientific-display {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.8rem;
  font-family: var(--font-mono);
  text-align: right;
  background-color: var(--bg-primary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  outline: none;
}

.calc-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.btn-sci {
  padding: 0.85rem 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.btn-sci:active {
  transform: translateY(1px);
}

.btn-sci-fn {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-size: 0.95rem;
}

.btn-sci-fn:hover {
  background-color: rgba(99, 102, 241, 0.22);
}

.btn-sci-op {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  font-size: 1.25rem;
}

.btn-sci-op:hover {
  background-color: rgba(245, 158, 11, 0.22);
}

.btn-sci-eval {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  font-weight: 700;
  border: none;
}

.btn-sci-eval:hover {
  background: linear-gradient(135deg, var(--primary-hover), #3730a3);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.height-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3rem;
  height: 280px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.height-silhouette {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.silhouette-body {
  width: 60px;
  border-radius: 30px 30px 4px 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
  transition: height 0.4s ease;
}

.silhouette-label {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-main);
}

/* ==========================================================================
   SEO Quick Scenario Presets
   ========================================================================== */
.calc-presets-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-color);
}

.preset-chip-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-chip {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.preset-chip:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border-color: var(--primary);
  color: var(--text-main);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.preset-chip:active {
  transform: translateY(0);
}

/* ==========================================================================
   SEO People Also Ask (PAA) FAQ Accordion
   ========================================================================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.faq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.faq-question {
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-icon-arrow {
  font-size: 0.85rem;
  color: var(--primary);
  transition: transform 0.25s ease;
}

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

.faq-answer {
  padding: 0 1.25rem 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

/* ==========================================================================
   Embed Code Box
   ========================================================================== */
.embed-code-textarea {
  width: 100%;
  background-color: var(--bg-input);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  resize: vertical;
  line-height: 1.5;
  outline: none;
}

.embed-code-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   Print Optimization
   ========================================================================== */
@media print {
  .site-header,
  .site-footer,
  .category-nav-bar,
  .calc-sidebar,
  .home-sidebar,
  .calc-actions-top,
  .calc-presets-row,
  .btn-primary,
  .btn-secondary,
  .modal-backdrop,
  .toast {
    display: none !important;
  }

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

  .calc-main-panel,
  .calc-header-card,
  .calc-body-card,
  .calc-educational-panel {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .calc-result-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
  }

  .result-main-value {
    color: #047857 !important;
  }
}

/* ==========================================================================
   Offline Status Pill & PWA Install Button
   ========================================================================== */
.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-emerald);
  letter-spacing: 0.02em;
}

.offline-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.pwa-install-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--primary);
  color: var(--text-main);
  animation: gentleGlow 3s infinite alternate;
}

@keyframes gentleGlow {
  0% { box-shadow: 0 0 5px rgba(99, 102, 241, 0.2); }
  100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
}

/* ==========================================================================
   Pillar Article Callout Banner (Internal Silo Linking)
   ========================================================================== */
.pillar-article-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
}

.pillar-article-banner:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pillar-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pillar-banner-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.pillar-banner-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.pillar-banner-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.pillar-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* ==========================================================================
   Frequently Used Together (Companion Tools)
   ========================================================================== */
.companion-tools-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.companion-tools-heading {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.companion-tool-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.companion-tool-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.companion-tool-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .offline-pill-text {
    display: none;
  }
  .pillar-article-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Article In-Depth FAQ Accordion
   ========================================================================== */
.article-faq-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.article-faq-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Interactive SVG Visualizer Charts
   ========================================================================== */
.chart-container {
  margin-top: 1.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
}

.chart-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-svg-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-svg {
  width: 100%;
  max-width: 620px;
  height: auto;
  max-height: 280px;
  overflow: visible;
}

/* ==========================================================================
   Favorites Shelf (User Bookmarked Calculators)
   ========================================================================== */
.favorites-shelf {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.favorites-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.favorites-title h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.fav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.fav-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-amber);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.fav-card-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.fav-remove-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   CSV Export Button
   ========================================================================== */
.btn-csv-export {
  background: var(--bg-input);
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-csv-export:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* ==========================================================================
   Real-Time Multi-Unit Live Conversion Matrix
   ========================================================================== */
.multi-matrix-container {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.multi-matrix-heading {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.multi-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.matrix-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.matrix-tile:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
}

.matrix-unit {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.matrix-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   THECALCVERSE SITE FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 4rem;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 15, 29, 0.9) 30%, #060912 100%);
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem 2rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

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

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.logo-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.footer-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 480px;
}

.footer-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

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

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(3px);
  display: inline-block;
}

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

.footer-copyright {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}





