.cm-tool {
  --brand-orange: #FF6B35;
  --brand-orange-dark: #e85d26;
  --brand-navy: #1A1A2E;
  --brand-blue: #16213E;
  --text-primary: #333333;
  --text-secondary: #666666;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --input-border: #D1D5DB;
  --input-focus: #FF6B35;
}

.cm-tool * { box-sizing: border-box; margin: 0; padding: 0; }
.cm-tool { font-family: 'DM Sans', -apple-system, sans-serif; font-size: 16px; line-height: 1.7; color: var(--text-primary); background: transparent; }
.cm-tool [hidden] { display: none !important; }

/* ===== MOBILE-SAFE CONTRACT ===== */
.cm-tool { max-width: 100%; overflow-x: hidden; }
.cm-tool .calc-wrapper { width: min(720px, 100%); max-width: 100%; margin: 0 auto; padding: 24px; }
.cm-tool .calc-wrapper * { min-width: 0; }
.cm-tool input, .cm-tool select, .cm-tool textarea, .cm-tool button { max-width: 100%; }
.cm-tool .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.cm-tool .results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.cm-tool .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cm-tool .calc-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 16px; }
.cm-tool .calc-table th { background: var(--brand-navy); color: white; padding: 10px 12px; text-align: left; font-weight: 600; }
.cm-tool .calc-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.cm-tool .calc-table tr:nth-child(even) td { background: var(--bg-light); }

.cm-tool h2 { font-size: 22px; font-weight: 700; color: var(--brand-navy); margin-bottom: 20px; }
.cm-tool h3 { font-size: 18px; font-weight: 600; color: var(--brand-navy); margin: 0 0 8px; }

.cm-tool .field-group { margin-bottom: 16px; }
.cm-tool .field-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--text-primary); }
.cm-tool .field-hint { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.cm-tool input[type="number"], .cm-tool input[type="text"], .cm-tool select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--input-border); border-radius: 8px;
  font-size: 16px; font-family: inherit; background: var(--bg-white); color: var(--text-primary);
  transition: border-color 0.2s;
}
.cm-tool input:focus, .cm-tool select:focus { outline: none; border-color: var(--input-focus); box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1); }

.cm-tool .slider-row { display: flex; align-items: center; gap: 12px; }
.cm-tool .slider-row input[type="range"] { flex: 1; }
.cm-tool .slider-row input[type="number"] { width: 96px; flex: 0 0 auto; }
.cm-tool input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--border); outline: none; min-height: 24px; background-clip: content-box; padding: 9px 0; }
.cm-tool input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-orange); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.cm-tool input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-orange); cursor: pointer; border: none; }

.cm-tool .result-card { background: var(--bg-light); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cm-tool .result-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 4px; }
.cm-tool .result-big { font-size: clamp(28px, 8vw, 48px); font-weight: 700; color: var(--brand-orange); line-height: 1.1; overflow-wrap: anywhere; }
.cm-tool .result-hero { text-align: center; padding: 24px 16px; margin-top: 8px; }
.cm-tool .result-hero .result-big { font-size: clamp(32px, 10vw, 56px); }
.cm-tool .result-secondary .result-big { font-size: 20px; color: var(--text-primary); }

.cm-tool .ymyl-disclaimer { background: #FFFBEB; border-left: 4px solid var(--warning); border-radius: 0 8px 8px 0; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; line-height: 1.5; color: #92400E; }
.cm-tool .live-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--success); font-weight: 500; margin: 4px 0 12px; }
.cm-tool .live-indicator::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.cm-tool .data-stamp { margin-top: 20px; padding: 10px 14px; background: #F0F4FA; border-left: 3px solid var(--brand-navy); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.cm-tool .data-stamp strong { color: var(--brand-navy); font-weight: 600; }

@media (max-width: 600px) {
  .cm-tool .calc-wrapper { padding: 16px; }
  .cm-tool .form-grid { grid-template-columns: 1fr; }
}

/* ===== DA calculator ===== */
.cm-tool .cm-da-error { background: #FEF2F2; border-left: 4px solid var(--error); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 14px; color: #991B1B; margin-bottom: 12px; }
.cm-tool .da-table td:not(:first-child), .cm-tool .da-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.cm-tool .da-strong td { font-weight: 700; }
.cm-tool .da-proj { margin-top: 24px; padding: 16px; border: 1px dashed var(--input-border); border-radius: 12px; }
.cm-tool .da-proj-note { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.cm-tool .da-proj-facts { margin: 12px 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.cm-tool .da-proj-facts li { margin-bottom: 4px; }


.cm-tool {
  --brand-orange: #17645f;
  --brand-orange-dark: #11524e;
  --brand-navy: #10302d;
  --brand-blue: #17645f;
  --text-primary: #10302d;
  --text-secondary: #4b5f5b;
  --bg-white: #fffdfa;
  --bg-light: #f6f2ec;
  --border: #e0d8cd;
  --input-border: #cfc5b8;
  --input-focus: #17645f;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text-primary);
}
.cm-tool .calc-wrapper { width: 100%; padding: 0; }
.cm-tool .calc-wrapper > h2:first-child { display: none; }
/* Result numbers were sized by screen width (8-10vw) inside half-width cards, so long figures
   like "₹1,98,88,715" overflowed and split mid-number. Size them to fit the card instead. */
.cm-tool .result-big { font-size: clamp(22px, 3.6vw, 42px); overflow-wrap: break-word; word-break: normal; font-variant-numeric: tabular-nums; }
.cm-tool .result-hero .result-big { font-size: clamp(26px, 4.4vw, 50px); }
