/* ===== CalcMojo design tokens (matches STYLE-GUIDE.md v1.1) ===== */
.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 {
  max-width: 100%;
  overflow-x: hidden;
}

.cm-tool {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: transparent;
}

.cm-tool .tool {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.cm-tool .tool * { min-width: 0; }

.cm-tool .tool-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 16px;
}

/* ----- toolbar ----- */
.cm-tool .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.cm-tool .btn {
  background: var(--bg-white);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  min-height: 38px;
}
.cm-tool .btn:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}
.cm-tool .btn:focus-visible {
  outline: 3px solid var(--input-focus);
  outline-offset: 2px;
}

/* ----- split pane ----- */
.cm-tool .split-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cm-tool .pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
}

.cm-tool .pane-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.cm-tool .pane-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.cm-tool .editor {
  width: 100%;
  flex: 1;
  min-height: 380px;
  padding: 14px 16px;
  border: none;
  background: var(--bg-white);
  font-family: 'SF Mono', 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
}
.cm-tool .editor:focus { background: #FCFCFD; }
.cm-tool .editor[readonly] { background: #FCFCFD; color: var(--text-primary); cursor: text; }

.cm-tool [hidden] { display: none !important; }

/* ----- toast ----- */
.cm-tool .toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--brand-navy);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ----- responsive: side-by-side from 768px ----- */
@media (min-width: 768px) {
  .cm-tool .split-pane {
    flex-direction: row;
  }
  .cm-tool .pane {
    flex: 1 1 50%;
    min-height: 520px;
  }
  .cm-tool .editor {
    min-height: 480px;
  }
}

@media (max-width: 600px) {
  .cm-tool .tool { padding: 16px; }
}

/* ----- accessibility ----- */
.cm-tool :focus { outline: none; }
.cm-tool :focus-visible {
  outline: 3px solid var(--input-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .cm-tool *, .cm-tool *::before, .cm-tool *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


.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); }
