/* ============================================
   MatrixSolverOro — Global Styles
   File: css/style.css
   Update: Edit variables at top for colors/fonts
   ============================================ */

/* ── CSS Variables ── */
:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --secondary: #0891b2;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --light: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --bg-gradient-start: #1d4ed8;
  --bg-gradient-end: #0891b2;
  --card-bg: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.15), 0 8px 24px rgba(0,0,0,.08);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --nav-height: 76px;
  --max-width: 1380px;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; font-size:16px; -webkit-text-size-adjust:100%; overflow-x:hidden; }
body {
  font-family: var(--font-main);
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width:100%; height:auto; display:block; }
a { color: inherit; text-decoration:none; }
ul, ol { list-style:none; }
button { font-family: var(--font-main); cursor:pointer; border:none; background:none; }
input, select, textarea { font-family: var(--font-main); }

/* ── Container ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 28px;
}
.container-wide { max-width:100%; padding:0 28px; }

/* ── NAVIGATION ── */
#site-nav {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--secondary);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(29,78,216,.3));
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: all .2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  background: rgba(29,78,216,.07);
  color: var(--primary);
}
.nav-link .arrow {
  font-size: 10px;
  transition: transform .2s;
}
.nav-item:hover .arrow { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .22s cubic-bezier(0.4,0,0.2,1);
  z-index: 999;
}
.dropdown-wide { min-width: 480px; display:grid; grid-template-columns:1fr 1fr; gap:0; }
.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-group { padding: 6px; }
.dropdown-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}
.dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: all .18s;
}
.dropdown a:hover {
  background: rgba(29,78,216,.07);
  color: var(--primary);
  transform: translateX(3px);
}
.nav-cta {
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(29,78,216,.3);
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(29,78,216,.4);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  color: #fff !important;
}

/* Hamburger */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
  cursor: pointer;
  z-index: 10001;
  position: relative;
  background: none;
  border: none;
}
.mobile-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
  transition: all .3s cubic-bezier(0.4,0,0.2,1);
}
.mobile-toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mobile-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ── HERO ── */
.hero {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}
.hero::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(29,78,216,.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(29,78,216,.08);
  color: var(--primary);
  border: 1px solid rgba(29,78,216,.15);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(16px, 2vw, 21px);
  color: var(--text-light);
  margin-bottom: 28px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.hero-tag {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
}
.hero-tag span { color: var(--success); font-weight: 700; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.8);
}
.card-body { padding: 40px 44px; }
.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 8px 24px rgba(29,78,216,.35);
  text-transform: uppercase;
  letter-spacing: .4px;
  will-change: transform;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(29,78,216,.45);
}
.btn-primary:active { transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  will-change: transform;
}
.btn-secondary:hover {
  background: rgba(29,78,216,.05);
  transform: translateY(-2px);
}
.btn-sm { padding: 10px 20px !important; font-size: 14px !important; }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  box-shadow: 0 8px 24px rgba(245,158,11,.35) !important;
}
.btn-accent:hover { box-shadow: 0 14px 32px rgba(245,158,11,.45) !important; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--light);
  transition: all .25s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(29,78,216,.1);
  background: #fff;
}
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ── INFO/ALERT BOXES ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert-info { background: #eff6ff; border-left: 4px solid var(--primary); color: #1e40af; }
.alert-success { background: #f0fdf4; border-left: 4px solid var(--success); color: #166534; }
.alert-warning { background: #fffbeb; border-left: 4px solid var(--warning); color: #92400e; }
.alert-error { background: #fef2f2; border-left: 4px solid var(--danger); color: #991b1b; }

/* ── FEATURES GRID ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 30px 0;
}
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all .3s;
  will-change: transform;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(29,78,216,.2);
}
.feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(29,78,216,.1), rgba(8,145,178,.1));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-light); line-height: 1.6; }

/* ── TOOLS GRID (homepage) ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 26px 0;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: all .3s;
  will-change: transform;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(29,78,216,.25);
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}
.tool-card h3 { font-size: 16px; font-weight: 700; }
.tool-card p { font-size: 13.5px; color: var(--text-light); flex:1; }
.tool-card a.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  transition: gap .2s;
}
.tool-card a.tool-link:hover { gap: 9px; }

/* ── FAQ ── */
.faq-list { margin: 20px 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  transition: background .2s;
  text-align: left;
}
.faq-question:hover { background: var(--light); }
.faq-question .faq-arrow {
  font-size: 18px;
  color: var(--primary);
  transition: transform .3s;
  flex-shrink: 0;
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--text-light);
  line-height: 1.7;
  background: #fff;
}
.faq-item.open .faq-answer { display: block; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 20px;
}
.breadcrumb a { color: rgba(255,255,255,.85); transition: color .2s; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { color: rgba(255,255,255,.5); }

/* ── SECTION HEADERS ── */
.section-header { margin-bottom: 36px; }
.section-header h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
  margin-bottom: 10px;
}
.section-header p {
  font-size: 17px;
  color: var(--text-light);
  max-width: 580px;
}
.section-header.centered { text-align: center; }
.section-header.centered p { margin: 0 auto; }

/* ── CONTENT SECTIONS ── */
.content-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}
.content-section h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.content-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 12px;
}
.content-section p { font-size: 15.5px; color: var(--text-light); margin-bottom: 14px; line-height: 1.75; }
.content-section ul, .content-section ol {
  margin: 12px 0 16px 22px;
  list-style: disc;
}
.content-section ul li, .content-section ol li {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 7px;
  line-height: 1.6;
}
.content-section ol { list-style: decimal; }
.content-section code {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--primary);
}
.content-section .math-formula {
  background: var(--light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 18px 0;
  overflow-x: auto;
  font-size: 15px;
}

/* ── FOOTER ── */
#site-footer {
  background: var(--dark);
  color: #e2e8f0;
  margin-top: 60px;
}
.footer-top {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 28px 40px;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 44px;
}
.footer-brand p {
  font-size: 14.5px;
  color: #94a3b8;
  margin: 14px 0 20px;
  line-height: 1.7;
  max-width: 300px;
}
.footer-brand .logo-link { margin-bottom: 0; }
.footer-brand .logo-text {
  background: linear-gradient(135deg, #60a5fa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.footer-social a {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 16px;
  transition: all .2s;
}
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #cbd5e1;
  margin-bottom: 18px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 14px;
  color: #94a3b8;
  transition: color .2s;
  display: block;
}
.footer-col ul li a:hover { color: #60a5fa; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { font-size: 13px; color: #64748b; }
.footer-bottom a { color: #64748b; }
.footer-bottom a:hover { color: #94a3b8; }
.footer-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-badge {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: #64748b;
}

/* ── LOADING SPINNER ── */
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text { font-size: 14px; color: var(--text-light); font-weight: 500; }

/* ── STATS ROW ── */
.stats-row {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 28px 0;
}
.stat-item {
  flex: 1;
  min-width: 130px;
  padding: 22px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* ── MOBILE NAV BACKDROP ── */
#nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility .32s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}
#nav-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (min-width: 769px) {
  #nav-backdrop { display: none !important; }
}

/* ── SCROLL-TO-TOP ── */
#scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(29,78,216,.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s;
  z-index: 900;
  border: none;
}
#scroll-top.visible { opacity: 1; transform: translateY(0); }
#scroll-top:hover { background: var(--primary-dark); }

/* ── PRINT ── */
@media print {
  #site-nav, #site-footer, #scroll-top { display: none !important; }
  body { background: #fff; }
  .card, .content-section { box-shadow: none !important; border: 1px solid #ccc; }
}

/* ══════════════════════════════════════════════════
   SYMPY / EXACT ENGINE UI
   ══════════════════════════════════════════════════ */

/* ── Status badge in calc-header ── */
.sympy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .4s, color .4s;
  white-space: nowrap;
}
.sympy-badge-loading {
  background: rgba(245,158,11,.12);
  color: #92400e;
  border: 1px solid rgba(245,158,11,.3);
}
.sympy-badge-ready {
  background: rgba(16,185,129,.12);
  color: #065f46;
  border: 1px solid rgba(16,185,129,.3);
}
.sympy-badge-failed {
  background: rgba(100,116,139,.1);
  color: var(--text-light);
  border: 1px solid var(--border);
}
.sympy-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sympy-dot-loading {
  background: #f59e0b;
  animation: se-pulse 1.2s ease-in-out infinite;
}
.sympy-dot-ready { background: #10b981; }
.sympy-dot-failed { background: #94a3b8; }
@keyframes se-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.8); }
}

/* ── Exact result card ── */
.se-card {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(16,185,129,.04) 0%, rgba(29,78,216,.04) 100%);
  border: 1.5px solid rgba(16,185,129,.28);
  border-radius: var(--radius-lg);
  padding: 22px 24px 20px;
}
.se-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.se-icon { font-size: 16px; }
.se-tag {
  margin-left: auto;
  background: rgba(16,185,129,.15);
  color: #065f46;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ── Values and notes ── */
.se-big-val .math-display,
.se-big-val { font-size: clamp(18px,3vw,26px); font-weight: 800; color: var(--text); }
.se-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Exact matrix table ── */
.se-matrix-block { margin-bottom: 14px; }
.se-matrix-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.se-matrix-scroll { overflow-x: auto; }
.se-mtable {
  border-collapse: collapse;
  margin: 0 auto;
  border-left: 3px solid #10b981;
  border-right: 3px solid #10b981;
}
.se-mtable tr:first-child td { padding-top: 10px; }
.se-mtable tr:last-child  td { padding-bottom: 10px; }
.se-cell {
  padding: 5px 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ── Eigenvalue list ── */
.se-eigen-list { display: flex; flex-direction: column; gap: 14px; }
.se-eigen-row  { display: flex; gap: 14px; align-items: flex-start; }
.se-eigen-num  {
  width: 30px; height: 30px;
  background: linear-gradient(135deg,#10b981,#059669);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0; margin-top: 4px;
}
.se-eigen-detail { flex: 1; min-width: 0; }
.se-eigen-val { font-size: 16px; font-weight: 700; color: var(--text); }
.se-eigen-vec {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── Vector chips ── */
.se-vec-row   { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.se-vec-chip  {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #065f46;
}

/* ── Rank boxes ── */
.se-rank-row { display: flex; gap: 14px; flex-wrap: wrap; }
.se-rank-box {
  flex: 1; min-width: 110px;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.se-rank-val { font-size: 32px; font-weight: 900; color: #059669; }
.se-rank-lbl { font-size: 12px; font-weight: 700; color: #065f46; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* ── Pending / loading state ── */
.se-pending { margin-top: 16px; }
.se-pending-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245,158,11,.07);
  border: 1px dashed rgba(245,158,11,.4);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13px;
  color: #92400e;
  font-weight: 600;
}
.se-spin {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(245,158,11,.3);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: se-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes se-spin { to { transform: rotate(360deg); } }

/* ── HOME SECTION PANELS (white cards for sections on blue background) ── */
.home-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}
.home-section .section-header { margin-bottom: 28px; }
.home-section .section-header h2 { color: var(--text); }
.home-section .section-header p { color: var(--text-light); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  :root { --nav-height: 68px; }

  /* CRITICAL: Remove backdrop-filter on mobile so position:fixed children
     are NOT trapped inside nav's bounds (browser containing-block bug) */
  #site-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #fff !important;
    z-index: 9999;
  }

  .mobile-toggle { display: flex; }

  /* Full-screen slide-in overlay menu — works because nav no longer
     creates a containing block with backdrop-filter */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: calc(var(--nav-height) + 24px) 24px 80px;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(0.4,0,0.2,1);
    z-index: 9998;
    /* Styled thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(29,78,216,.2) transparent;
  }
  .nav-menu::-webkit-scrollbar { width: 3px; }
  .nav-menu::-webkit-scrollbar-track { background: transparent; }
  .nav-menu::-webkit-scrollbar-thumb { background: rgba(29,78,216,.2); border-radius: 3px; }
  .nav-menu.open { transform: translateX(0); }

  .nav-item { width: 100%; }
  .nav-link { width: 100%; padding: 12px 14px; font-size: 15px; border-radius: 10px; }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid rgba(29,78,216,.15);
    background: rgba(29,78,216,.03);
    border-radius: 0 10px 10px 0;
    margin: 4px 0 4px 10px;
    display: none;
    min-width: calc(100% - 10px);
  }
  .dropdown-wide { grid-template-columns: 1fr; }
  .nav-item.open .dropdown { display: block; }
  .nav-item.open > .nav-link { background: rgba(29,78,216,.07); color: var(--primary); }
  .nav-cta { width: 100%; justify-content: center; margin-top: 10px; }

  .container { padding: 20px 16px; }
  .hero { padding: 36px 24px; }
  .card-body { padding: 24px 20px; }
  .content-section { padding: 28px 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; padding: 36px 20px 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .stats-row { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
}
@media (max-width: 480px) {
  .hero { padding: 28px 16px; }
  .section-title { font-size: 21px; }
  .tools-grid { grid-template-columns: 1fr; }
}
