/* ==========================================================================
   Modern Premium Dark Glassmorphism CSS Design System
   ========================================================================== */

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(56, 189, 248, 0.3);
  
  --color-primary: #38bdf8;
  --color-primary-glow: rgba(56, 189, 248, 0.4);
  --color-secondary: #c084fc;
  --color-accent: #f43f5e;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;

  --calc-body-bg: #1e1e2e;
  --calc-screen-bg: #11111b;
  --calc-screen-text: #a6e3a1;

  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(192, 132, 252, 0.15) 0px, transparent 50%);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

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

a:hover {
  color: var(--color-secondary);
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 38px;
  flex-shrink: 0;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  z-index: 150;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--color-primary);
}

.mobile-menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 110;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

.logo-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  flex-shrink: 0;
  contain: layout style;
}

.logo-group:hover {
  transform: translateY(-1px);
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #818cf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  color: #ffffff;
  height: 28px;
  line-height: 28px;
  white-space: nowrap;
  min-width: 135px;
  box-sizing: border-box;
}

.logo-text .logo-highlight {
  background: linear-gradient(135deg, #38bdf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 1px;
  display: inline-block;
  height: 28px;
  line-height: 28px;
  min-width: 62px;
  box-sizing: border-box;
}

.logo-badge {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(126, 34, 206, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  backdrop-filter: blur(8px);
  align-self: center;
  flex-shrink: 0;
  height: 20px;
  line-height: 16px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

/* Header Search Container - Layout Boundary Locked */
.header-search {
  position: relative;
  width: 440px;
  max-width: 100%;
  height: 42px;
  box-sizing: border-box;
  flex-shrink: 0;
  contain: layout size;
}

.header-search input {
  width: 100%;
  height: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.6);
  color: var(--color-text);
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.header-search input::placeholder {
  color: #94a3b8;
  font-size: 0.86rem;
}

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

.header-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* Search Suggestions Dropdown */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: opacity 0.15s ease;
  will-change: opacity;
}

.search-suggestions-dropdown.hidden {
  display: none;
}

.search-suggestion-item {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  background: transparent;
  min-height: 52px;
  box-sizing: border-box;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background: rgba(56, 189, 248, 0.15);
  border-left: 3px solid var(--color-primary);
}

.suggestion-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 18px;
  line-height: 1;
}

.suggestion-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.suggestion-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.no-suggestions {
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Layout Grid */
.layout-wrapper {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

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

.category-nav-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 500;
  background: transparent;
  transition: all 0.2s ease;
}

.category-nav-item a:hover, .category-nav-item a.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-primary);
  transform: translateX(4px);
}

.category-count-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  color: var(--color-text-muted);
}

/* Sidebar Recommendations Section (Below Categories / Sports) */
.sidebar-recommendations-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
}

.sidebar-recommendations-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-recommendations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-rec-item a {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-rec-item a:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--color-primary);
  transform: translateX(4px);
}

.sidebar-rec-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-rec-name {
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  flex: 1;
}

/* Main Content */
.main-content {
  padding: 2rem;
  min-width: 0;
  max-width: 100%;
}

/* Hero Banner Area */
.hero-banner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

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

/* Physical Banner Calculator Card */
.physical-calc-card-wrapper {
  width: 100%;
}

.physical-calc-card {
  background: #1e1e2e;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  width: 100%;
  box-sizing: border-box;
}

/* Fullscreen Mode Styling - Real Hardware Calculator Center Card */
.physical-calc-card-wrapper:fullscreen,
.physical-calc-card-wrapper:-webkit-full-screen,
.physical-calc-card-wrapper.fullscreen-active {
  background: #0b0f19 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5vh 2vw !important;
  box-sizing: border-box !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 999999 !important;
  overflow: hidden !important;
}

.physical-calc-card-wrapper:fullscreen .physical-calc-card,
.physical-calc-card-wrapper:-webkit-full-screen .physical-calc-card,
.physical-calc-card-wrapper.fullscreen-active .physical-calc-card {
  background: #1e1e2e !important;
  border: 2px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  padding: min(1.25rem, 2vh) min(1.5rem, 2.5vw) !important;
  width: 100% !important;
  max-width: min(520px, 92vw) !important;
  max-height: 96vh !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 2px 2px rgba(255, 255, 255, 0.2) !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

.physical-calc-card-wrapper.fullscreen-active .calc-top-bar,
.physical-calc-card-wrapper:fullscreen .calc-top-bar {
  margin-bottom: min(0.75rem, 1.2vh) !important;
}

.physical-calc-card-wrapper.fullscreen-active .calc-screen-wrapper,
.physical-calc-card-wrapper:fullscreen .calc-screen-wrapper {
  margin-bottom: min(0.85rem, 1.4vh) !important;
  padding: min(0.75rem, 1.3vh) min(1rem, 2vw) !important;
  border-radius: 14px !important;
  background: #11111b !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

.physical-calc-card-wrapper.fullscreen-active .calc-expr-display,
.physical-calc-card-wrapper:fullscreen .calc-expr-display {
  font-size: min(0.9rem, 1.5vh) !important;
  min-height: min(1.1rem, 1.8vh) !important;
}

.physical-calc-card-wrapper.fullscreen-active .calc-main-display,
.physical-calc-card-wrapper:fullscreen .calc-main-display {
  font-size: min(2rem, 3.6vh) !important;
}

.physical-calc-card-wrapper.fullscreen-active .calc-keypad,
.physical-calc-card-wrapper:fullscreen .calc-keypad {
  gap: min(0.5rem, 0.9vh) !important;
  flex-grow: 1 !important;
}

.physical-calc-card-wrapper.fullscreen-active .btn,
.physical-calc-card-wrapper:fullscreen .btn {
  padding: min(0.6rem, 1.2vh) min(0.4rem, 0.8vw) !important;
  font-size: min(0.95rem, 1.8vh) !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.physical-calc-card-wrapper.fullscreen-active .btn-sci,
.physical-calc-card-wrapper:fullscreen .btn-sci {
  font-size: min(0.85rem, 1.6vh) !important;
}

.physical-calc-card-wrapper.fullscreen-active .angle-toggle-wrapper,
.physical-calc-card-wrapper:fullscreen .angle-toggle-wrapper {
  padding: min(0.25rem, 0.6vh) min(0.5rem, 1vw) !important;
  font-size: min(0.8rem, 1.5vh) !important;
}

.calc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.calc-brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.calc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.calc-dot.red { background: #f38ba8; }
.calc-dot.yellow { background: #f9e2af; }
.calc-dot.green { background: #a6e3a1; }

.calc-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: #cdd6f4;
  margin-left: 0.5rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .calc-title {
    display: none;
  }
}

.calc-mode-selector {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--color-primary);
  color: #0f172a;
}

.calc-screen-wrapper {
  background: var(--calc-screen-bg);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: right;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-expr-display {
  font-size: 0.8rem;
  color: #7f849c;
  min-height: 1.2rem;
}

.calc-main-display {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--calc-screen-text);
  font-family: monospace;
  overflow-x: auto;
}

.calc-keypad {
  display: grid;
  gap: 0.5rem;
}

.standard-grid {
  grid-template-columns: repeat(4, 1fr);
}

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

.hero-banner {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.angle-toggle-wrapper {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 0.35rem;
  background: #2a2a3c;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cdd6f4;
  min-width: 0;
  box-sizing: border-box;
}

.angle-toggle-wrapper label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.angle-toggle-wrapper input[type="radio"] {
  accent-color: var(--color-primary);
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.calc-angle-indicator {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-primary);
  background: rgba(56, 189, 248, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.btn {
  background: #313244;
  color: #cdd6f4;
  border: none;
  padding: 0.6rem 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 3px 0 #181825;
  transition: all 0.1s ease;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #181825;
}

.btn-num { background: #45475a; color: #fff; }
.btn-op { background: #89b4fa; color: #11111b; }
.btn-sci { background: #cba6f7; color: #11111b; font-size: 0.8rem; }
.btn-warn { background: #fab387; color: #11111b; }
.btn-danger { background: #f38ba8; color: #11111b; }
.btn-equal { background: #a6e3a1; color: #11111b; grid-column: span 1; }
.btn-zero { grid-column: span 2; }

/* Grid of Calculators Cards */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.calc-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.15);
}

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

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

.calc-card-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.25s ease;
}

.calc-card:hover .calc-card-icon-badge {
  transform: scale(1.08) rotate(3deg);
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--color-primary);
}

.calc-card-category {
  font-size: 0.72rem;
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.calc-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.calc-card:hover .calc-card-title {
  color: #38bdf8;
}

.calc-card-desc {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calc-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.calc-card-btn span {
  transition: transform 0.2s ease;
}

.calc-card:hover .calc-card-btn {
  color: #93c5fd;
}

.calc-card:hover .calc-card-btn span {
  transform: translateX(4px);
}

/* Calculator View Page */
.calculator-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.calc-header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  flex-shrink: 0;
}

.back-link:hover {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(-3px);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.back-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.back-link:hover svg {
  transform: translateX(-1px);
}

.calc-runner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #e2e8f0;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
}

.outputs-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.output-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.output-row:last-child {
  border-bottom: none;
}

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

.output-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.val-converted-result {
  color: #10b981 !important; /* Emerald Green */
}

.val-initial-value {
  color: #f59e0b !important; /* Amber Orange */
}

.val-selected-conversion {
  color: #c084fc !important; /* Purple */
}

.val-formula-model {
  color: #f38ba8 !important; /* Pastel Pink / Rose */
  font-family: monospace;
}

/* SEO Article Styles */
.seo-article-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.seo-article {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-top: 2.5rem;
  color: #cbd5e1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

.seo-article img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.seo-article .math-display {
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.seo-article .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.seo-article table {
  max-width: 100%;
}

/* Enhanced Mermaid Diagram Styling */
.seo-article .mermaid-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  padding: 2rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  overflow-x: auto;
  overflow-y: hidden;
}

.seo-article pre.mermaid {
  background: transparent !important;
  color: #fff;
  font-family: inherit;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.seo-article pre.mermaid svg,
.seo-article .mermaid-container svg {
  max-width: 100% !important;
  height: auto !important;
  font-family: inherit !important;
  overflow: visible !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;
}

.seo-article .mermaid-container svg text.pieTitleText,
.seo-article pre.mermaid svg text.pieTitleText,
.seo-article .mermaid-container svg text.title-text,
.seo-article pre.mermaid svg text.title-text,
.seo-article .mermaid-container svg text.titleText,
.seo-article pre.mermaid svg text.titleText,
.seo-article .mermaid-container svg .title text,
.seo-article pre.mermaid svg .title text,
.seo-article .mermaid-container svg text.title,
.seo-article pre.mermaid svg text.title {
  font-size: 18px !important;
  font-weight: 700 !important;
  fill: #f8fafc !important;
  text-anchor: middle !important;
  text-align: center !important;
}

.seo-article pre.mermaid .cluster rect {
  fill: rgba(30, 41, 59, 0.4) !important;
  stroke: rgba(56, 189, 248, 0.3) !important;
  stroke-width: 1px !important;
  rx: 8px !important;
  ry: 8px !important;
}

.seo-article .mermaid-container svg .node .label {
  font-weight: 500 !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  text-align: center !important;
  font-family: inherit !important;
}

.seo-article .mermaid-container svg .node .label text {
  font-size: 13.5px !important;
  font-family: inherit !important;
}

.seo-article .mermaid-container svg .node foreignObject div {
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  text-align: center !important;
  word-break: normal !important;
  white-space: normal !important;
}

.seo-article .mermaid-container svg .node rect,
.seo-article .mermaid-container svg .node circle,
.seo-article .mermaid-container svg .node ellipse,
.seo-article .mermaid-container svg .node polygon {
  stroke-width: 2px !important;
  rx: 8px !important;
  ry: 8px !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.seo-article .mermaid-container svg .edgePath .path {
  stroke: #38bdf8 !important;
  stroke-width: 2.2px !important;
}

.seo-article .mermaid-container svg .edgeLabel {
  font-weight: 600 !important;
  background-color: #0f172a !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.seo-article h2 { font-size: 1.8rem; margin-bottom: 1rem; color: #fff; }
.seo-article h3 { font-size: 1.3rem; margin: 1.5rem 0 0.75rem 0; color: var(--color-primary); }
.seo-article h4 { font-size: 1.1rem; margin: 1rem 0 0.5rem 0; color: #f1f5f9; }
.seo-article p { margin-bottom: 1rem; line-height: 1.7; }

.formula-box {
  background: rgba(56, 189, 248, 0.1);
  border-left: 4px solid var(--color-primary);
  padding: 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1rem 0;
}

.formula-title { font-weight: 700; color: var(--color-primary); margin-bottom: 0.25rem; }
.formula-content { font-family: monospace; font-size: 1.1rem; color: #fff; }

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

.param-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.faq-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.faq-question { color: #fff; font-weight: 600; margin-bottom: 0.4rem; }

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Design System
   ========================================================================== */

/* Tablets and Desktops below 1024px */
@media (max-width: 1024px) {
  .header {
    padding: 0.75rem 1rem;
  }
  
  .header-search {
    width: 280px;
  }

  .layout-wrapper {
    grid-template-columns: 240px 1fr;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .physical-calc-card {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .header {
    padding: 0.6rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .header-left {
    gap: 0.6rem;
  }

  .logo-group {
    font-size: 1.15rem;
    gap: 0.4rem;
  }

  .logo-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .header-search {
    width: 100%;
    order: 3;
  }

  .header-search input {
    padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    font-size: 0.85rem;
  }

  .header-search-icon {
    left: 0.75rem;
    font-size: 0.85rem;
  }

  /* Off-canvas Mobile Sidebar */
  .layout-wrapper {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 290px;
    height: 100vh;
    background: #0f172a;
    border-right: 1px solid var(--border-glow);
    z-index: 120;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.open {
    transform: translateX(320px);
  }

  .main-content {
    padding: 1rem 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }

  /* Hero Section Mobile */
  .hero-banner {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
  }

  .hero-text h1 {
    font-size: 1.6rem;
    line-height: 1.25;
    margin-bottom: 0.6rem;
  }

  .hero-text p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 0.6rem;
  }

  .stat-card {
    padding: 0.6rem 1rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  /* Physical Calculator on Mobile */
  .physical-calc-card {
    max-width: 100%;
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .calc-main-display {
    font-size: 1.4rem;
  }

  .btn {
    padding: 0.55rem 0.15rem;
    font-size: 0.82rem;
  }

  .btn-sci {
    font-size: 0.68rem;
    padding: 0.55rem 0.1rem;
  }

  .angle-toggle-wrapper {
    padding: 0.25rem 0.2rem;
    font-size: 0.72rem;
    gap: 0.2rem;
  }

  .angle-toggle-wrapper input[type="radio"] {
    width: 12px;
    height: 12px;
  }

  /* Calculator View Page Mobile */
  .calculator-view-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  .calculator-view-card h1 {
    font-size: 1.5rem !important;
  }

  .calc-runner-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
  }

  .inputs-card, .outputs-card {
    padding: 1rem;
  }

  .output-row {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }

  .output-val {
    font-size: 1.1rem;
    word-break: break-all;
  }

  /* Calculator Cards Grid */
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* SEO Article Mobile Formatting */
  .seo-article {
    padding: 1.25rem 0.85rem;
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
  }

  .seo-article h2 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .seo-article h3 {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .seo-article p,
  .seo-article li {
    font-size: 0.95rem;
  }

  .table-responsive {
    margin: 1rem 0;
  }

  .table-responsive table {
    font-size: 0.85rem;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem 0.6rem;
  }

  .formula-box {
    padding: 0.85rem 1rem;
  }

  .formula-content {
    font-size: 0.95rem;
    word-break: break-all;
  }

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

  /* Sitemap on Mobile */
  .sitemap-view-card {
    padding: 1.25rem;
  }

  .sitemap-view-card h1 {
    font-size: 1.7rem !important;
  }

  .sitemap-categories-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Small Smartphone Screen Adjustments (max-width: 480px) */
@media (max-width: 480px) {
  .logo-group {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   Legal & Compliance Pages Styling - Premium Modern Layout
   ========================================================================== */
.legal-page-container {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  margin: 1.5rem auto 3rem auto;
  backdrop-filter: blur(20px);
  max-width: 1050px;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  animation: fadeInLegal 0.3s ease-out;
}

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

.legal-header-box {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 2rem;
  margin-bottom: 2.25rem;
}

.legal-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.legal-page-title {
  font-size: 2.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.85rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-page-summary {
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
  max-width: 900px;
}

.legal-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 600;
}

.legal-date {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.legal-domain {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(192, 132, 252, 0.2);
}

/* Nav Tabs */
.legal-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.legal-tab-btn.active {
  background: var(--color-primary);
  color: #0b1120;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

/* Content Body */
.legal-content-body {
  color: #cbd5e1;
  font-size: 1.06rem;
  line-height: 1.8;
}

.legal-section {
  margin-bottom: 2.75rem;
}

/* Headings with Distinct Colors */
.legal-section h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 2.25rem;
  margin-bottom: 1.15rem;
  padding-left: 0.85rem;
  border-left: 4px solid #38bdf8;
  letter-spacing: -0.01em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #c084fc; /* Distinct Lavender/Purple for H3 */
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-section h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #a6e3a1; /* Distinct Mint Green for H4 */
  margin-top: 1.35rem;
  margin-bottom: 0.6rem;
}

.legal-section p {
  margin-bottom: 1.15rem;
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.75;
}

.legal-section strong {
  color: #ffffff;
  font-weight: 700;
}

.legal-section ul {
  margin-left: 1.75rem;
  margin-bottom: 1.35rem;
  list-style-type: disc;
}

.legal-section li {
  margin-bottom: 0.65rem;
  color: #cbd5e1;
  font-size: 1.02rem;
  line-height: 1.7;
}

.legal-section a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-section a:hover {
  color: #93c5fd;
}

/* Alert Callout Box */
.legal-alert-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-left: 5px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 1.35rem 1.75rem;
  margin: 1.75rem 0;
  color: #fef08a;
  font-size: 1.05rem;
  line-height: 1.65;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.legal-alert-box p {
  margin-bottom: 0;
  color: #fef08a;
}

/* Highlight Cards Grid */
.legal-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.legal-highlight-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.legal-highlight-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.15);
}

.legal-highlight-icon {
  font-size: 1.75rem;
  margin-bottom: 0.65rem;
}

.legal-highlight-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.legal-highlight-card p {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Legal Structured Table with Distinct Rows and Columns Borders */
.legal-table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.98rem;
}

.legal-table th {
  background: rgba(30, 41, 59, 0.95);
  padding: 1.1rem 1.25rem;
  color: #38bdf8; /* Cyan header */
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid rgba(56, 189, 248, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-table th:last-child {
  border-right: none;
}

.legal-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Explicit row borders */
  border-right: 1px solid rgba(255, 255, 255, 0.08); /* Explicit column borders */
  color: #cbd5e1;
  line-height: 1.65;
  vertical-align: top;
}

.legal-table td:last-child {
  border-right: none;
}

.legal-table td strong {
  color: #a5b4fc; /* Distinct highlight for first column terms */
}

.legal-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.legal-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

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

@media (max-width: 768px) {
  .legal-page-container {
    padding: 1.75rem 1.25rem;
    margin: 1rem auto 2rem auto;
  }

  .legal-page-title {
    font-size: 1.85rem;
  }

  .legal-page-summary {
    font-size: 1rem;
  }

  .legal-nav-tabs {
    flex-direction: column;
    gap: 0.4rem;
  }

  .legal-tab-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .legal-section h2 {
    font-size: 1.35rem;
  }

  .legal-section h3 {
    font-size: 1.12rem;
  }

  .legal-section p, .legal-section li {
    font-size: 0.96rem;
  }

  .legal-highlight-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Site Footer Styling
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(16px);
  padding: 3.5rem 2rem 2rem 2rem;
  margin-top: 4rem;
  position: relative;
  z-index: 10;
}

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

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-desc {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-top: 0.85rem;
  max-width: 520px;
}

.footer-links-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-col a {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--color-primary);
  transform: translateX(3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  gap: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-copyright strong {
  color: #94a3b8;
}

.footer-legal-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-legal-inline a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.footer-legal-inline a:hover {
  color: var(--color-primary);
}

.footer-legal-inline span {
  color: #475569;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 2.5rem 1rem 1.5rem 1rem;
    margin-top: 2.5rem;
  }

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

  .footer-links-group {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .footer-col h4 {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
  }

  .footer-col a {
    font-size: 0.84rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .legal-page-container {
    padding: 1.25rem 1rem;
  }

  .legal-page-title {
    font-size: 1.75rem;
  }
}

/* ==========================================================================
   404 & 500 Error Pages Styling
   ========================================================================== */
.error-page-container {
  max-width: 850px;
  margin: 3rem auto;
  padding: 3.5rem 2rem;
  text-align: center;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.error-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #f43f5e;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.error-badge-pill.error-500 {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.error-code-large {
  font-size: 6.5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #38bdf8 0%, #c084fc 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
}

.error-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1rem;
}

.error-desc {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn-error-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
}

.btn-error-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.btn-error-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--color-text);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-error-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.error-recs-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}
