/* Minimal calculator-specific tweaks only (cg-ui provides core UI) */

#cg-cd-form textarea.cg-input { resize: vertical; }
#cg-cd-form .cg-result-message { white-space: normal; }

#cg-cd-status { margin-top: 12px !important; margin-bottom: 14px !important; }

/* Sex radio row: pills */
#cg-cd-form .cg-cd-radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
#cg-cd-form .cg-cd-radio {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 999px;
  background: #fff; cursor: pointer; user-select: none;
}
#cg-cd-form .cg-cd-radio input { width: 16px; height: 16px; }

/* Toggle icon alignment like green circle (▲ text) */
#cg-top .cg-section-toggle-icon{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  color: #22c55e !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
}
#cg-top .cg-section-toggle-icon:hover{
  background: rgba(0, 223, 82, 0.12) !important;
}

/* Activity select: no cut text */
#cg-cd-form .cg-cd-activity { width: 100%; min-width: 100%; white-space: nowrap; }

/* Result colored bars */
#cg-cd-form .cg-cd-bar { position: relative; padding-left: 14px; }
#cg-cd-form .cg-cd-bar::before{
  content:""; position:absolute; left:0; top:10px; bottom:10px; width:6px;
  border-radius:999px; background:#e5e7eb;
}
#cg-cd-form .cg-cd-bar--required::before { background:#ef4444; }
#cg-cd-form .cg-cd-bar--bmr::before      { background:#3b82f6; }
#cg-cd-form .cg-cd-bar--maint::before    { background:#10b981; }
#cg-cd-form .cg-cd-bar--surplus::before  { background:#f59e0b; }

/* Results actions + feedback stay inside results container */
#cg-cd-form .cg-cd-results-actions-wrap{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

/* actions row */
#cg-cd-form .cg-cd-actions{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap; width:100%; box-sizing:border-box;
}
#cg-cd-form .cg-cd-actions-left{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#cg-cd-form .cg-cd-actions-right{ display:flex; align-items:center; }

/* did-we-solve row strictly inside */
#cg-cd-form .cg-cd-feedback{
  margin-top:12px;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  flex-wrap:wrap !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  position:static !important;
  transform:none !important;
}
#cg-cd-form .cg-cd-feedback-buttons{
  display:flex !important;
  gap:10px !important;
  margin-left:auto !important;
  position:static !important;
  transform:none !important;
}
#cg-cd-form .cg-cd-feedback-buttons .cg-feedback-btn{
  position:static !important;
  transform:none !important;
}

/* Custom calendar - portal to BODY, so use FIXED positioning */
#cg-cd-form .cg-cd-date-wrap{ position:relative; }
#cg-cd-form .cg-cd-date-input{ padding-right: 44px; cursor: pointer; }

/* Use a native-looking calendar icon on the right */
#cg-cd-form .cg-cd-date-hit{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:32px;
  height:32px;
  border:0;
  background:transparent;
  cursor:pointer;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
#cg-cd-form .cg-cd-date-hit::before{
  content:"";
  width:18px;
  height:18px;
  display:block;
  background-repeat:no-repeat;
  background-position:center;
  background-size:18px 18px;
  opacity:.75;
  /* simple calendar svg to match old native feel */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}
#cg-cd-form .cg-cd-date-hit:hover{ background: rgba(17,24,39,0.06); }

/* Calendar dropdown (fixed because it is moved to <body>) */
.cg-cd-cal{
  position:fixed; /* IMPORTANT */
  width:300px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
  padding:10px;
  z-index: 9999;
  display:none;
}
.cg-cd-cal.is-open{ display:block; }

.cg-cd-cal__hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.cg-cd-cal__title{ font-weight:600; font-size:.95rem; }
.cg-cd-cal__nav{
  width:34px; height:34px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  border-radius:10px;
  cursor:pointer;
}

.cg-cd-cal__dow{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:4px;
  font-size:.75rem;
  color:#6b7280;
  margin-bottom:6px;
}
.cg-cd-cal__dow span{ text-align:center; padding:4px 0; }

.cg-cd-cal__grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:4px;
}
.cg-cd-cal__day{
  height:34px;
  border:1px solid transparent;
  background:#fff;
  border-radius:10px;
  cursor:pointer;
}
.cg-cd-cal__day:hover{ background:#f3f4f6; }
.cg-cd-cal__day.is-outside{ color:#9ca3af; }
.cg-cd-cal__day.is-today{ border-color:#22c55e; }
.cg-cd-cal__day.is-selected{
  background:#22c55e;
  color:#fff;
  border-color:#22c55e;
}

.cg-cd-cal__ft{
  display:flex;
  justify-content:space-between;
  margin-top:8px;
}
.cg-cd-cal__link{
  border:0;
  background:transparent;
  color:#2563eb;
  cursor:pointer;
  padding:6px 8px;
  border-radius:10px;
}
.cg-cd-cal__link:hover{ background:#eff6ff; }
/* space between Copy all outputs and status message */
#cg-cd-form .cg-cd-copyall-row{ margin-bottom: 10px; }
