/* Index Hub Styles */
.statmat-tool.index-hub {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  color: #333;
  background-color: #fafafa;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  border: 1px solid #eaeaea;
  overflow: hidden;
}

.statmat-tool.index-hub * {
  box-sizing: border-box;
}

.statmat-tool.index-hub .hub-header {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  padding: 40px 24px;
  text-align: center;
}

.statmat-tool.index-hub .hub-icon {
  font-size: 42px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.statmat-tool.index-hub .hub-header h2 {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.statmat-tool.index-hub .hub-header p {
  margin: 0;
  font-size: 18px;
  opacity: 0.9;
}

.statmat-tool.index-hub .hub-container {
  padding: 40px 30px;
}

.statmat-tool.index-hub .section-title {
  margin: 0 0 24px 0;
  font-size: 22px;
  color: #1e3c72;
  border-bottom: 2px solid #eaeaea;
  padding-bottom: 8px;
}

.statmat-tool.index-hub .tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.statmat-tool.index-hub .tool-card {
  display: block;
  text-decoration: none;
  background-color: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  color: inherit;
}

.statmat-tool.index-hub .tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(30, 60, 114, 0.1);
  border-color: #2a5298;
}

.statmat-tool.index-hub .card-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.statmat-tool.index-hub .tool-card h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #222;
  font-weight: 700;
}

.statmat-tool.index-hub .tool-card p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

@media (max-width: 650px) {
  .statmat-tool.index-hub .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* Global override for mobile scrolling on long results */
.statmat-tool [class*="result"], 
.statmat-tool [class*="output"],
.statmat-tool [class*="preview"],
.statmat-tool [class*="display"] {
  overflow-x: auto;
  max-width: 100%;
}

/* Global safeguard: ensure main wrapper never exceeds mobile viewport */
.statmat-tool {
  width: 100% !important;
  box-sizing: border-box;
}
