/* Gravty Cost Calculator */
:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1d2433;
  --muted: #6b7280;
  --primary: #ff7a00;
  --primary-dark: #e36a00;
  --border: #e0e4ec;
  --accent: #f0f4ff;
  --success: #16a34a;
  --warning: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
header {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: #fff;
  padding: 24px 40px;
}
header h1 { margin: 0 0 4px; font-size: 1.5rem; }
header .subtitle { margin: 0; color: #d1d5db; font-size: 0.9rem; }
main { max-width: 1280px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--text);
}
.hint, .hint-inline { color: var(--muted); font-size: 0.85rem; }
.hint-inline { font-weight: normal; }

/* Inputs */
.inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.inputs-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
  font-size: 0.9rem;
}
.inputs-grid small { color: var(--muted); font-weight: normal; font-size: 0.75rem; }
input[type="number"], select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

/* Scenarios */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.scenario {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fafbfc);
  position: relative;
}
.scenario.recommended { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.scenario.recommended::before {
  content: "Recommended for vertical";
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}
.scenario-name { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.scenario-profiles { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; line-height: 1.4; }
.scenario-cost { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); margin: 8px 0 4px; }
.scenario-split { font-size: 0.75rem; color: var(--muted); }
.scenario-pick {
  margin-top: 12px;
  width: 100%;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.scenario-pick:hover { background: var(--primary); color: #fff; }

/* Profiles */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.profile-block {
  background: #f9fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
}
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.profile-label { font-weight: 600; font-size: 0.88rem; }
.info-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
}
.info-btn:hover { color: var(--primary-dark); }
.profile-block select { width: 100%; }
.profile-impact {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.2em;
}

/* Custom result */
.custom-result {
  margin-top: 20px;
  padding: 16px 20px;
  background: linear-gradient(120deg, var(--accent), #f8faff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.custom-result .label { color: var(--muted); font-size: 0.9rem; }
.custom-result .total { font-size: 2rem; font-weight: 700; color: var(--primary-dark); }
.custom-result .split { font-size: 0.8rem; color: var(--muted); }

/* Breakdown */
.breakdown { display: flex; flex-direction: column; gap: 14px; }
.breakdown-section h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--text);
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.breakdown-table th, .breakdown-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.breakdown-table th { background: #f9fafc; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.breakdown-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown-table tr.subtotal { font-weight: 700; background: #f0f4ff; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}
.modal-content h3 { margin: 0 0 12px; }
.modal-content p { margin: 0 0 8px; }
.modal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.85rem;
}
.modal-content th, .modal-content td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.modal-content th { background: #f9fafc; }

footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  header { padding: 20px; }
  main { padding: 16px; }
  .card { padding: 16px; }
}
