:root {
  --primary: #d6021a;
  --primary-dark: #b90216;
  --bg-color: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.page-subtext {
  text-align: center;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem auto;
  font-size: 1.1rem;
  line-height: 1.6;
}

.subtitle-bar {
  width: 6rem;
  height: 0.375rem;
  background-color: var(--primary);
  border-radius: 9999px;
  margin: 0 auto 3rem auto;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Home Tool Cards */
.home-tool-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%; 
  min-height: 340px; 
  transition: transform 0.2s, box-shadow 0.2s;
}

.home-tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px -5px rgb(0 0 0 / 0.1);
  border-color: var(--primary);
}

.card-seo-text {
  margin-top: auto; 
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  border: 1px solid #e2e8f0;
}

/* --- Forms & Buttons --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #334155;
}

input[type="text"], input[type="date"] {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box; 
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(214, 2, 26, 0.1);
}

button.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: white;
  font-weight: 700;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.125rem;
  transition: background-color 0.2s;
  box-shadow: 0 4px 6px -1px rgba(214, 2, 26, 0.3);
}

button.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* --- Results Styles (Common) --- */
.result-box {
  animation: fadeIn 0.5s ease-out;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: center;
}

.stat-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #64748b; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

/* --- Lo Shu Grid Styles --- */
.loshu-grid-display {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 250px;
  margin: 0 auto;
  background: #1e293b;
  padding: 0.5rem;
  border-radius: 0.75rem;
}
.grid-cell {
  height: 4.5rem;
  background: #334155;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 0.375rem;
}
.grid-cell.active {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: white;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* --- Mobile Numerology & Name Numerology Output Styles --- */
.blocks-flex { display:flex; flex-wrap:wrap; gap:1.3em; margin-top:1.25em; }

.block-card { 
  background:#fff; 
  border-radius:13px; 
  box-shadow:0 2px 9px #b0292912; 
  border: 1px solid #e2e8f0;
  flex:1 1 145px; 
  min-width:116px; 
  padding:1.32em .85em 1em .85em; 
  display:flex; 
  flex-direction:column; 
  align-items:center;
}

.block-title {
  font-weight:700; 
  margin-bottom:.44em; 
  color: var(--primary);
  font-size: 0.9rem;
  text-align: center;
}

.block-badge {
  padding:9px 22px; 
  margin-bottom:.7em; 
  background: var(--primary); 
  color:#fff; 
  border-radius:2em; 
  font-size:1.5em; 
  font-weight:800; 
  letter-spacing:.05em;
}

.block-badge.rul {
  background:#f2eaea; 
  color: var(--primary);
}

.block-desc {
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.mob-analy { 
  background: #fff3f4; 
  border-radius: 12px; 
  padding: 1.5em; 
  box-shadow:0 2px 12px #f1727212; 
  margin-bottom:1.5em; 
  font-size:1.05em;
  border: 1px solid #fecdd3;
  color: #1e293b;
}

.good-combo {
  background:#fff8f1; 
  border-left: 4px solid #fab938; 
  margin-bottom:1.5em; 
  border-radius:7px; 
  padding:1em 1.5em; 
  color:#b04909;
}

.section-title {
  margin-top:2em;
  color: var(--primary);
  font-size:1.13em;
  font-weight:700;
  margin-bottom: 1em;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.compat-note {
  font-size:1.1rem;
  margin-top:1em;
  color:#1e293b;
  text-align:center;
  font-weight: 500;
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 1rem;
}

.score-bar-wrap { margin:0 auto 1.5em auto; max-width:400px; }
.score-bar-label { font-weight:700; font-size:1.13em; margin-bottom:11px; text-align:center; letter-spacing:.05em; color: #334155; }
.score-bar-bg { background:#e2e8f0; height:28px; border-radius:14px; overflow:hidden; }
.score-bar { height:28px; background: linear-gradient(90deg, #d6021a 87%, #ef4444 130%); border-radius:13px; text-align:right; color:#fff; font-weight:700; padding-right:18px; line-height:28px; font-size:1em; transition:width .9s; }

/* SEO Content */
.seo-content {
  background: white;
  border-top: 4px solid var(--primary);
  padding: 2.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  margin-top: 3rem;
}
.seo-content h2 { color: #1e293b; margin-top: 0; }
.seo-content p { color: #475569; margin-bottom: 1rem; }

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

@media (max-width: 640px) {
  nav ul { gap: 1rem; }
  nav a { font-size: 0.85rem; padding: 1rem 0; }
  h1 { font-size: 1.75rem; }
  .grid-3 { grid-template-columns: 1fr; }
}