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

body {
  font-family: sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #f5f5f5;
  color: #222;
}

h1 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

/* Bulk input row */
#bulk-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

#bulk-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 4px;
}

button {
  padding: 0.5rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: #3a7bd5;
  color: #fff;
}

button:hover { background: #2f64b5; }

/* Feature grid — wide screens: all 10 side by side */
#feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.feature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.6rem 0.5rem;
  min-width: 90px;
  flex: 1;
}

.feature-block label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

.feat-input {
  width: 100%;
  padding: 0.35rem 0.4rem;
  font-size: 1rem;
  text-align: center;
  border: 1px solid #bbb;
  border-radius: 4px;
}

/* Predictions below the input on wide screens */
.preds {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 3.2rem;
}

.pred-min { color: #cc0000; }
.pred-exp { color: #1a7f1a; }
.pred-max { color: #0055cc; }

#predict-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#predict-btn {
  background: #2a9d2a;
  font-size: 1.05rem;
  padding: 0.6rem 2rem;
  flex-shrink: 0;
}

#predict-btn:hover { background: #228022; }

#ad-banner {

}

/* Footer */
#totals-section {
  margin-top: 2rem;
  padding: 0.75rem 0;
  font-size: 0.95rem;
}

#totals-section .total-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

#totals-section .total-label { color: #444; min-width: 240px; }

#totals-section #total-min { color: #cc0000; font-weight: 600; }
#totals-section #total-exp { color: #1a7f1a; font-weight: 600; }
#totals-section #total-max { color: #0055cc; font-weight: 600; }

hr.section-rule { border: none; border-top: 1px solid #ddd; margin: 0; }

#site-footer {
  margin-top: 0;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

#site-footer a {
  color: #3a7bd5;
  text-decoration: none;
  margin: 0 0.75rem;
  cursor: pointer;
}

#site-footer a:hover { text-decoration: underline; }

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  min-width: 320px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-box h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover { color: #222; background: none; }

/* Cookie consent banner */
#consent-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #222;
  color: #fff;
  padding: 1rem 1.5rem;
  z-index: 2000;
  font-size: 0.9rem;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#consent-banner.visible { display: flex; }

#consent-banner p { flex: 1; margin: 0; min-width: 200px; }

#consent-banner .consent-buttons { display: flex; gap: 0.5rem; flex-shrink: 0; }

#consent-accept {
  background: #2a9d2a;
  color: #fff;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
}

#consent-accept:hover { background: #228022; }

#consent-decline {
  background: #666;
  color: #fff;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
}

#consent-decline:hover { background: #444; }

/* Narrow screens: features stacked, predictions to the right */
@media (max-width: 600px) {
  #feature-grid {
    flex-direction: column;
    gap: 0.5rem;
  }

  .feature-block {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    min-width: unset;
  }

  .feature-block label {
    width: 70px;
    text-align: left;
    flex-shrink: 0;
  }

  .feat-input {
    width: 60px;
    flex-shrink: 0;
  }

  .preds {
    flex-direction: row;
    gap: 0.6rem;
    min-height: unset;
    align-items: center;
  }
}
