/* Use the shared glass nav */
@import url("/components/nav.css");

/* ---- Base ---- */
:root { color-scheme: only light; }
html, body { height: 100%; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #a4a8b0;           /* flat grey as requested */
  padding-top: 5rem;             /* space for fixed nav */
}

/* ---- Container ---- */
.container {
  box-sizing: border-box;
  background: #fff;
  width: min(92vw, 900px);
  margin: 20px auto;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  text-align: center;
}

h1 { margin: 0 0 1rem; font-size: 1.6rem; }

/* ---- Pills ---- */
#personPills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .75rem;
}
.pill {
  padding: .45rem .9rem;
  border: 0;
  border-radius: 9999px;
  background: #e5e5e5;
  cursor: pointer;
}
.pill.active { background:#007bff; color:#fff; }

/* =========================================
   🧩 FIX: Contain date and person fields inside card (iOS)
   ========================================= */
.form-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.form-row input[type="date"],
.form-row input[type="text"] {
  width: 90%;
  max-width: 280px;
  height: 38px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0 0.6rem;
  font-size: 1rem;
  text-align: center;
  background-color: #fff;
}

/* Keep the +/- and weight nicely centered */
.weight-input {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Save button spacing */
#saveBtn {
  margin-top: 0.5rem;
}

/* Mobile refinement */
@media (max-width: 768px) {
  .form-row input[type="date"],
  .form-row input[type="text"] {
    width: 95%;
    max-width: none;
    font-size: 0.95rem;
  }
}


/* ---- Chart wrap controls size (no mobile scroll) ---- */
.chart-wrap {
  width: 100%;
  height: 320px;           /* desktop/tablet height */
  margin-top: 1rem;
}
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important; /* let parent decide height */
}

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0;
  display: none; place-items: center;
  background: rgba(0,0,0,.5);
  z-index: 1000;
}
.modal:not(.hidden) { display: grid; }
.modal-content {
  background: #fff; width: min(92vw, 340px);
  padding: 16px; border-radius: 12px; text-align: center;
}

/* ---- Mobile tweaks ---- */
@media (max-width: 768px) {
  body { padding-top: 5.5rem; }
  .container { width: min(94vw, 680px); padding: 16px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  #saveBtn { margin-top: .25rem; }
  .chart-wrap { height: 240px; }  /* shorter to avoid scrolling */
}
