/* ==========================================================
   CALCULATOR TOOLS - COMMON CORE STYLES
   Extracted from calculator-tools.css (lines 1-1616)
   ========================================================== */
/* ==========================================================
   CALCULATOR TOOLS — COMMON CSS
   File       : calculator-tools.css
   Prefix     : ct-
   Author     : ToolsHub4u.com
   Description: Shared styles for ALL calculator tools.
                Every class uses the "ct-" prefix so there
                are zero conflicts with the host page.
   ========================================================== */

/* ----------------------------------------------------------
   0. CUSTOM PROPERTIES (design tokens)
   ---------------------------------------------------------- */
.ct-tool-section {
  /* — brand colours — */
  --ct-primary       : #6366f1;
  --ct-primary-hover : #4f46e5;
  --ct-primary-light : #818cf8;
  --ct-primary-glow  : rgba(99, 102, 241, .35);
  --ct-secondary     : #ec4899;
  --ct-success       : #10b981;
  --ct-warning       : #f59e0b;
  --ct-danger        : #ef4444;
  --ct-info          : #3b82f6;

  /* — gradients — */
  --ct-grad-start    : #312e81;
  --ct-grad-end      : #4c1d95;

  /* — surfaces — */
  --ct-card-bg       : rgba(14, 22, 38, .92);
  --ct-card-border   : rgba(148, 163, 184, .18);
  --ct-card-shadow   : 0 20px 60px rgba(0, 0, 0, .5);
  --ct-glass-bg      : rgba(255, 255, 255, .06);
  --ct-glass-border  : rgba(255, 255, 255, .12);

  /* — text — */
  --ct-text          : #e7ecf5;
  --ct-text-secondary: #9aa8bd;
  --ct-text-muted    : #64748b;
  --ct-text-white    : #ffffff;

  /* — inputs — */
  --ct-input-bg      : #131d33;
  --ct-input-border  : rgba(148, 163, 184, .16);
  --ct-input-focus   : var(--ct-primary);

  /* — radii — */
  --ct-r-sm : 8px;
  --ct-r-md : 12px;
  --ct-r-lg : 16px;
  --ct-r-xl : 24px;

  /* — spacing scale — */
  --ct-sp-xs : 4px;
  --ct-sp-sm : 8px;
  --ct-sp-md : 16px;
  --ct-sp-lg : 24px;
  --ct-sp-xl : 32px;
  --ct-sp-2xl: 48px;

  /* — typography — */
  --ct-font  : 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* — motion — */
  --ct-ease  : cubic-bezier(.4, 0, .2, 1);
  --ct-speed : .3s;
}

/* ----------------------------------------------------------
   1. SECTION WRAPPER
   ---------------------------------------------------------- */
.ct-tool-section {
  position      : relative;
  width         : 100%;
  padding       : var(--ct-sp-xl) var(--ct-sp-md);
  background    : linear-gradient(135deg, var(--ct-grad-start), var(--ct-grad-end));
  font-family   : var(--ct-font);
  line-height   : 1.5;
  color         : var(--ct-text);
  overflow      : hidden;
  overflow-x    : hidden;
  box-sizing    : border-box;
}

/* Ensure calculator containers adapt to light/dark theme correctly */
.cat-content {
  background: var(--bg) !important;
  color: var(--text-primary) !important;
}
.cat-article h2,
.cat-article h3 {
  color: var(--text-primary) !important;
}
.cat-article p,
.cat-article li {
  color: var(--text-secondary) !important;
}

/* reset box‑sizing inside the section */
.ct-tool-section,
.ct-tool-section *,
.ct-tool-section *::before,
.ct-tool-section *::after {
  box-sizing: border-box;
  min-width : 0;
  margin    : 0;
  padding   : 0;
  /* mobile touch optimizations */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.ct-tool-section * {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* decorative floating shapes */
.ct-section-bg-shapes {
  position     : absolute;
  inset        : 0;
  pointer-events: none;
  overflow     : hidden;
  z-index      : 0;
}

.ct-shape {
  position      : absolute;
  border-radius : 50%;
  background    : rgba(255, 255, 255, .06);
}

.ct-shape-1 {
  width : 500px; height: 500px;
  top   : -180px; right: -120px;
  animation: ctFloat 18s ease-in-out infinite;
}
.ct-shape-2 {
  width : 350px; height: 350px;
  bottom: -100px; left: -80px;
  animation: ctFloat 22s ease-in-out infinite reverse;
}
.ct-shape-3 {
  width : 200px; height: 200px;
  top   : 40%;   left: 50%;
  animation: ctFloat 15s ease-in-out infinite 3s;
}

@keyframes ctFloat {
  0%, 100% { transform: translate(0, 0)   scale(1);   }
  33%      { transform: translate(30px, -40px) scale(1.05); }
  66%      { transform: translate(-20px, 25px) scale(.95);  }
}

/* ----------------------------------------------------------
   2. LAYOUT — SINGLE COLUMN (TOOL)
   ---------------------------------------------------------- */
.ct-layout {
  position             : relative;
  z-index              : 1;
  display              : grid;
  grid-template-columns: 1fr;
  gap                  : var(--ct-sp-lg);
  max-width            : 1000px;
  margin               : 0 auto;
  align-items          : start;
}

/* ----------------------------------------------------------
   4. TOOL CONTAINER
   ---------------------------------------------------------- */
.ct-tool-container {
  width    : 100%;
  max-width: 100%;
  margin   : 0 auto;
}

/* ----------------------------------------------------------
   5. CARD
   ---------------------------------------------------------- */
.ct-card {
  background            : var(--ct-card-bg);
  backdrop-filter        : blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border                : 1px solid var(--ct-card-border);
  border-radius         : var(--ct-r-xl);
  box-shadow            : var(--ct-card-shadow);
  overflow              : hidden;
  transition            : box-shadow var(--ct-speed) var(--ct-ease);
}

.ct-card:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, .13);
}

/* — card header — */
.ct-card-header {
  padding      : var(--ct-sp-lg) var(--ct-sp-lg) var(--ct-sp-md);
  text-align   : center;
  background   : linear-gradient(135deg,
                   rgba(99, 102, 241, .04),
                   rgba(236, 72, 153, .04));
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.ct-card-icon {
  display   : inline-block;
  font-size : 36px;
  line-height: 1;
  margin-bottom: var(--ct-sp-xs);
  animation : ctBounce 2.5s ease-in-out infinite;
}

@keyframes ctBounce {
  0%, 100% { transform: translateY(0);    }
  50%      { transform: translateY(-6px); }
}

.ct-card-title {
  font-size  : 23px;
  font-weight: 800;
  color      : var(--ct-text);
  line-height: 1.25;
}

.ct-card-subtitle {
  font-size : 14px;
  color     : var(--ct-text-secondary);
  margin-top: var(--ct-sp-xs);
}

/* — card body — */
.ct-card-body {
  padding: 18px 22px;
}

/* — card footer (optional) — */
.ct-card-footer {
  padding     : var(--ct-sp-sm) var(--ct-sp-lg);
  border-top  : 1px solid rgba(0, 0, 0, .05);
  text-align  : center;
  font-size   : 12px;
  color       : var(--ct-text-muted);
}

/* ----------------------------------------------------------
   6. FORMS
   ---------------------------------------------------------- */
.ct-form { width: 100%; }

/* grid rows */
.ct-form-row {
  display : grid;
  gap     : var(--ct-sp-md);
  margin-bottom: var(--ct-sp-md);
}
.ct-form-row.ct-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ct-form-row.ct-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ct-form-row.ct-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* single group */
.ct-form-group {
  display       : flex;
  flex-direction: column;
  gap           : var(--ct-sp-xs);
}

/* labels */
.ct-label {
  font-size  : 14px;
  font-weight: 600;
  color      : var(--ct-text);
  display    : flex;
  align-items: center;
  gap        : var(--ct-sp-xs);
}

.ct-required { color: var(--ct-danger); font-weight: 700; }
.ct-optional { font-size: 12px; color: var(--ct-text-muted); font-weight: 400; }

/* input wrapper (for future icons/addons) */
.ct-input-wrap {
  position: relative;
  display : flex;
}

/* text / number / date inputs */
.ct-input,
.ct-select,
.ct-textarea {
  width             : 100%;
  padding           : 10px 14px;
  font-size         : 14px;
  font-family       : var(--ct-font);
  color             : var(--ct-text);
  background        : var(--ct-input-bg);
  border            : 2px solid var(--ct-input-border);
  border-radius     : var(--ct-r-md);
  outline           : none;
  transition        : border-color var(--ct-speed) var(--ct-ease),
                      box-shadow  var(--ct-speed) var(--ct-ease),
                      background  var(--ct-speed) var(--ct-ease);
  -webkit-appearance: none;
  appearance        : none;
}

.ct-input:hover,
.ct-select:hover,
.ct-textarea:hover {
  border-color: #cbd5e1;
}

.ct-input:focus,
.ct-select:focus,
.ct-textarea:focus {
  border-color: var(--ct-input-focus);
  box-shadow  : 0 0 0 4px rgba(99, 102, 241, .12);
  background  : #fff;
}

.ct-input.ct-has-error {
  border-color: var(--ct-danger);
  box-shadow  : 0 0 0 4px rgba(239, 68, 68, .10);
}

.ct-textarea {
  resize    : vertical;
  min-height: 100px;
}

/* select arrow */
.ct-select {
  padding-right    : 40px;
  cursor           : pointer;
  background-image : url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat  : no-repeat;
  background-position: right 14px center;
  background-size    : 12px;
}

/* error messages */
.ct-error {
  display   : block;
  min-height: 18px;
  font-size : 12px;
  font-weight: 500;
  color     : var(--ct-danger);
  margin-top: 2px;
}

/* input addons (prefix / suffix inside input-wrap) */
.ct-input-prefix,
.ct-input-suffix {
  position       : absolute;
  top            : 50%;
  transform      : translateY(-50%);
  font-size      : 14px;
  color          : var(--ct-text-muted);
  pointer-events : none;
  font-weight    : 600;
}
.ct-input-prefix { left : 14px; }
.ct-input-suffix { right: 14px; }
.ct-input-wrap .ct-input.ct-has-prefix { padding-left : 40px; }
.ct-input-wrap .ct-input.ct-has-suffix { padding-right: 40px; }

/* ----------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------- */
.ct-btn-group {
  display        : flex;
  gap            : var(--ct-sp-md);
  justify-content: center;
  flex-wrap      : wrap;
}

.ct-btn {
  display        : inline-flex;
  align-items    : center;
  justify-content: center;
  gap            : var(--ct-sp-sm);
  padding        : 11px 26px;
  font-size      : 14px;
  font-weight    : 600;
  font-family    : var(--ct-font);
  line-height    : 1;
  border         : 2px solid transparent;
  border-radius  : var(--ct-r-md);
  cursor         : pointer;
  transition     : all var(--ct-speed) var(--ct-ease);
  text-decoration: none;
  -webkit-appearance: none;
  appearance     : none;
  user-select    : none;
}

.ct-btn:active { transform: scale(.97); }

.ct-btn-icon {
  font-size   : 18px;
  line-height : 1;
  display     : inline-flex;
}

/* primary */
.ct-btn-primary {
  background : linear-gradient(135deg, var(--ct-primary), var(--ct-primary-hover));
  color      : var(--ct-text-white);
  box-shadow : 0 4px 14px var(--ct-primary-glow);
}
.ct-btn-primary:hover {
  background : linear-gradient(135deg, var(--ct-primary-hover), #4338ca);
  box-shadow : 0 6px 22px var(--ct-primary-glow);
  transform  : translateY(-2px);
}

/* outline / reset */
.ct-btn-outline {
  background  : transparent;
  color       : var(--ct-text-secondary);
  border-color: var(--ct-input-border);
}
.ct-btn-outline:hover {
  background  : var(--ct-input-bg);
  border-color: #cbd5e1;
  color       : var(--ct-text);
}

/* secondary */
.ct-btn-secondary {
  background : var(--ct-input-bg);
  color      : var(--ct-text);
  border-color: var(--ct-input-border);
}
.ct-btn-secondary:hover {
  background: rgba(99, 102, 241, .12);
  border-color: var(--ct-primary-light);
}

/* danger */
.ct-btn-danger {
  background : var(--ct-danger);
  color      : #fff;
}
.ct-btn-danger:hover {
  background: #dc2626;
  transform : translateY(-2px);
}

/* small variant */
.ct-btn-sm {
  padding  : 10px 20px;
  font-size: 13px;
}

/* ----------------------------------------------------------
   8. RESULTS AREA
   ---------------------------------------------------------- */
.ct-result {
  padding    : 20px 22px;
  border-top : 1px solid rgba(0, 0, 0, .05);
  background : linear-gradient(135deg,
                rgba(99, 102, 241, .025),
                rgba(236, 72, 153, .025));
  animation  : ctFadeUp .5s var(--ct-ease);
}

@keyframes ctFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.ct-result[hidden] { display: none; }

.ct-result-heading {
  font-size  : 16px;
  font-weight: 700;
  text-align : center;
  color      : var(--ct-text);
  margin-bottom: var(--ct-sp-md);
  word-break : break-word;
}

.ct-result {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* result cards grid */
.ct-result-grid {
  display: grid;
  gap    : 10px;
}
.ct-result-grid.ct-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ct-result-grid.ct-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ct-result-grid.ct-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* individual result card */
.ct-result-card {
  text-align   : center;
  padding      : 12px 10px;
  background   : var(--ct-input-bg);
  border       : 1px solid var(--ct-input-border);
  border-radius: var(--ct-r-sm);
  transition   : transform var(--ct-speed) var(--ct-ease),
                 box-shadow var(--ct-speed) var(--ct-ease);
}
.ct-result-card:hover {
  transform : translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

/* accent card (highlighted number) */
.ct-result-card.ct-result-accent {
  background  : linear-gradient(135deg, var(--ct-primary), var(--ct-primary-hover));
  border-color: transparent;
}
.ct-result-card.ct-result-accent .ct-result-value,
.ct-result-card.ct-result-accent .ct-result-label {
  color: #fff;
}

.ct-result-value {
  display    : block;
  font-size  : clamp(20px, 3.2vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  color      : var(--ct-primary);
}

.ct-result-label {
  display       : block;
  margin-top    : 3px;
  font-size     : 10.5px;
  font-weight   : 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color         : var(--ct-text-secondary);
}

/* summary sentence */
.ct-result-summary {
  margin-top   : var(--ct-sp-md);
  padding      : var(--ct-sp-sm) var(--ct-sp-md);
  background   : rgba(99, 102, 241, .06);
  border-left  : 4px solid var(--ct-primary);
  border-radius: 0 var(--ct-r-sm) var(--ct-r-sm) 0;
  font-size    : 13.5px;
  font-weight  : 600;
  color        : var(--ct-text);
  text-align   : center;
}
.ct-result-summary:empty { display: none; }

/* ----------------------------------------------------------
   9. DETAIL BOX (breakdown table-like)
   ---------------------------------------------------------- */
.ct-detail-box {
  margin-top   : var(--ct-sp-md);
  padding      : var(--ct-sp-md);
  background   : #fff;
  border       : 1px solid var(--ct-input-border);
  border-radius: var(--ct-r-md);
}

.ct-detail-title {
  font-size    : 14px;
  font-weight  : 700;
  color        : var(--ct-text);
  margin-bottom: var(--ct-sp-sm);
  display      : flex;
  align-items  : center;
  gap          : var(--ct-sp-sm);
}

.ct-detail-list {
  list-style: none;
  display   : grid;
  gap       : var(--ct-sp-sm);
}

.ct-detail-item {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  padding        : var(--ct-sp-sm) var(--ct-sp-md);
  background     : var(--ct-input-bg);
  border-radius  : var(--ct-r-sm);
  font-size      : 14px;
  transition     : background var(--ct-speed) var(--ct-ease);
}
.ct-detail-item:hover { background: rgba(99, 102, 241, .05); }

.ct-detail-key {
  color      : var(--ct-text-secondary);
  font-weight: 500;
  display    : flex;
  align-items: center;
  gap        : var(--ct-sp-sm);
}

.ct-detail-val {
  color      : var(--ct-text);
  font-weight: 700;
  text-align : right;
}

/* ----------------------------------------------------------
   10. TABS (for multi-mode tools: unit converter, etc.)
   ---------------------------------------------------------- */
.ct-tabs {
  display       : flex;
  gap           : var(--ct-sp-xs);
  padding       : 4px;
  background    : var(--ct-input-bg);
  border-radius : var(--ct-r-md);
  margin-bottom : var(--ct-sp-md);
  overflow-x    : auto;
  -webkit-overflow-scrolling: touch;
}

.ct-tab {
  flex       : 1;
  padding    : 8px 14px;
  font-size  : 12.5px;
  font-weight: 600;
  font-family: var(--ct-font);
  text-align : center;
  border     : none;
  background : transparent;
  color      : var(--ct-text-secondary);
  border-radius: var(--ct-r-sm);
  cursor     : pointer;
  transition : all var(--ct-speed) var(--ct-ease);
  white-space: nowrap;
}
.ct-tab:hover           { color: var(--ct-text); background: rgba(0,0,0,.04); }
.ct-tab.ct-tab-active   { color: #fff; background: var(--ct-primary); box-shadow: 0 2px 8px var(--ct-primary-glow); }

.ct-tab-panel           { display: none; }
.ct-tab-panel.ct-active { display: block; animation: ctFadeUp .3s var(--ct-ease); }

/* ----------------------------------------------------------
   11. RANGE / SLIDER
   ---------------------------------------------------------- */
.ct-range-group {
  display       : flex;
  flex-direction: column;
  gap           : var(--ct-sp-sm);
}

.ct-range-header {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
}

.ct-range-val {
  font-size  : 14px;
  font-weight: 700;
  color      : var(--ct-primary);
  background : rgba(99, 102, 241, .08);
  padding    : 4px 12px;
  border-radius: var(--ct-r-sm);
}

.ct-range {
  -webkit-appearance: none;
  appearance        : none;
  width             : 100%;
  height            : 8px;
  background        : var(--ct-input-border);
  border-radius     : 4px;
  outline           : none;
  cursor            : pointer;
}
.ct-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width      : 22px;
  height     : 22px;
  border-radius: 50%;
  background : var(--ct-primary);
  border     : 3px solid #fff;
  box-shadow : 0 2px 8px rgba(0,0,0,.18);
  cursor     : grab;
}
.ct-range::-moz-range-thumb {
  width      : 22px;
  height     : 22px;
  border-radius: 50%;
  background : var(--ct-primary);
  border     : 3px solid #fff;
  box-shadow : 0 2px 8px rgba(0,0,0,.18);
  cursor     : grab;
}

/* ----------------------------------------------------------
   12. TOGGLE SWITCH
   ---------------------------------------------------------- */
.ct-switch-wrap {
  display    : flex;
  align-items: center;
  gap        : var(--ct-sp-sm);
}

.ct-switch {
  position  : relative;
  width     : 48px;
  height    : 26px;
  display   : inline-block;
  flex-shrink: 0;
}
.ct-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.ct-switch-slider {
  position     : absolute;
  inset        : 0;
  background   : var(--ct-input-border);
  border-radius: 26px;
  cursor       : pointer;
  transition   : background var(--ct-speed) var(--ct-ease);
}
.ct-switch-slider::after {
  content      : '';
  position     : absolute;
  top          : 3px;
  left         : 3px;
  width        : 20px;
  height       : 20px;
  border-radius: 50%;
  background   : #fff;
  box-shadow   : 0 1px 4px rgba(0,0,0,.15);
  transition   : transform var(--ct-speed) var(--ct-ease);
}
.ct-switch input:checked + .ct-switch-slider {
  background: var(--ct-primary);
}
.ct-switch input:checked + .ct-switch-slider::after {
  transform: translateX(22px);
}

/* ----------------------------------------------------------
   13. ALERT / INFO BOX
   ---------------------------------------------------------- */
.ct-alert {
  padding      : var(--ct-sp-md) var(--ct-sp-lg);
  border-radius: var(--ct-r-md);
  font-size    : 14px;
  font-weight  : 500;
  margin-bottom: var(--ct-sp-md);
  display      : flex;
  align-items  : flex-start;
  gap          : var(--ct-sp-sm);
}
.ct-alert-info    { background: rgba(59,130,246,.08);  color: #1e40af; border-left: 4px solid var(--ct-info);    }
.ct-alert-success { background: rgba(16,185,129,.08);  color: #065f46; border-left: 4px solid var(--ct-success); }
.ct-alert-warning { background: rgba(245,158,11,.08);  color: #92400e; border-left: 4px solid var(--ct-warning); }
.ct-alert-danger  { background: rgba(239,68,68,.08);   color: #991b1b; border-left: 4px solid var(--ct-danger);  }

/* ----------------------------------------------------------
   14. BADGE
   ---------------------------------------------------------- */
.ct-badge {
  display       : inline-flex;
  align-items   : center;
  padding       : 4px 12px;
  font-size     : 12px;
  font-weight   : 700;
  border-radius : 20px;
  letter-spacing: .5px;
}
.ct-badge-primary { background: rgba(99,102,241,.12); color: var(--ct-primary); }
.ct-badge-success { background: rgba(16,185,129,.12); color: var(--ct-success); }
.ct-badge-warning { background: rgba(245,158,11,.12); color: var(--ct-warning); }
.ct-badge-danger  { background: rgba(239,68,68,.12);  color: var(--ct-danger);  }

/* ----------------------------------------------------------
   15. TABLE (responsive)
   ---------------------------------------------------------- */
.ct-table-wrap {
  width     : 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border    : 1px solid var(--ct-input-border);
  border-radius: var(--ct-r-md);
  margin-bottom: var(--ct-sp-md);
}

.ct-table {
  width          : 100%;
  border-collapse: collapse;
  font-size      : 14px;
}
.ct-table th,
.ct-table td {
  padding   : 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ct-input-border);
}
.ct-table th {
  background : var(--ct-input-bg);
  font-weight: 700;
  font-size  : 13px;
  color      : var(--ct-text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ct-table tr:last-child td { border-bottom: none; }
.ct-table tr:hover td      { background: rgba(99,102,241,.03); }

/* ----------------------------------------------------------
   16. PROGRESS BAR
   ---------------------------------------------------------- */
.ct-progress {
  width        : 100%;
  height       : 10px;
  background   : var(--ct-input-border);
  border-radius: 10px;
  overflow     : hidden;
  margin       : var(--ct-sp-sm) 0;
}
.ct-progress-bar {
  height       : 100%;
  background   : linear-gradient(90deg, var(--ct-primary), var(--ct-primary-light));
  border-radius: 10px;
  transition   : width .6s var(--ct-ease);
}

/* ----------------------------------------------------------
   17. DIVIDER
   ---------------------------------------------------------- */
.ct-divider {
  border      : none;
  border-top  : 1px solid var(--ct-input-border);
  margin      : var(--ct-sp-lg) 0;
}

.ct-divider-text {
  display    : flex;
  align-items: center;
  gap        : var(--ct-sp-md);
  color      : var(--ct-text-muted);
  font-size  : 13px;
  font-weight: 600;
  margin     : var(--ct-sp-lg) 0;
}
.ct-divider-text::before,
.ct-divider-text::after {
  content   : '';
  flex      : 1;
  height    : 1px;
  background: var(--ct-input-border);
}

/* ----------------------------------------------------------
   18. UTILITY CLASSES
   ---------------------------------------------------------- */
.ct-text-center  { text-align : center !important; }
.ct-text-right   { text-align : right  !important; }
.ct-mt-sm        { margin-top : var(--ct-sp-sm) !important; }
.ct-mt-md        { margin-top : var(--ct-sp-md) !important; }
.ct-mt-lg        { margin-top : var(--ct-sp-lg) !important; }
.ct-mb-sm        { margin-bottom: var(--ct-sp-sm) !important; }
.ct-mb-md        { margin-bottom: var(--ct-sp-md) !important; }
.ct-mb-lg        { margin-bottom: var(--ct-sp-lg) !important; }
.ct-hidden       { display: none !important; }
.ct-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------
   19. LOADING SPINNER
   ---------------------------------------------------------- */
.ct-spinner {
  display       : inline-block;
  width         : 24px;
  height        : 24px;
  border        : 3px solid var(--ct-input-border);
  border-top-color: var(--ct-primary);
  border-radius : 50%;
  animation     : ctSpin .7s linear infinite;
}
@keyframes ctSpin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------
   19b. BMI GAUGE
   ---------------------------------------------------------- */
.ct-bmi-gauge-wrap { padding: 6px 4px 0; }
.ct-bmi-gauge {
  position: relative;
  padding : 30px 0 22px;
}
.ct-bmi-gauge-bar {
  display        : flex;
  height         : 14px;
  border-radius  : 999px;
  overflow       : hidden;
  background     : rgba(255, 255, 255, .08);
}
.ct-bmi-zone { flex: 1; transition: opacity .2s ease; }
.ct-bmi-under   { background: #3b82f6; }
.ct-bmi-normal  { background: #22c55e; }
.ct-bmi-over    { background: #eab308; }
.ct-bmi-obese1  { background: #f97316; }
.ct-bmi-obese2  { background: #ef4444; }
.ct-bmi-obese3  { background: #b91c1c; }

.ct-bmi-pointer {
  position : absolute;
  bottom   : 0;
  left     : 0;
  transform: translateX(-50%);
  transition: left .6s var(--ct-ease);
  z-index  : 2;
  display  : flex;
  flex-direction: column;
  align-items    : center;
}
.ct-bmi-pointer-val {
  background   : var(--ct-text);
  color        : var(--ct-grad-start);
  font-size    : 12px;
  font-weight  : 800;
  padding      : 3px 8px;
  border-radius: 8px;
  white-space  : nowrap;
  box-shadow   : 0 4px 12px rgba(0, 0, 0, .3);
}
.ct-bmi-pointer-arrow {
  width : 0;
  height: 0;
  border-left : 7px solid transparent;
  border-right: 7px solid transparent;
  border-top  : 8px solid var(--ct-text);
}

.ct-bmi-gauge-labels {
  display    : flex;
  margin-top : var(--ct-sp-sm);
  font-size  : 11px;
  font-weight: 700;
  color      : var(--ct-text-muted);
  text-align : center;
}
.ct-bmi-gauge-labels span { flex: 1; line-height: 1.4; }

/* ----------------------------------------------------------
   20. RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------- */

/* ≤ 1199 px — narrower centered card */
@media (max-width: 1199px) {
  .ct-layout {
    grid-template-columns: 1fr;
    max-width            : 780px;
  }

  .ct-tool-container { order: 0; }
}

@media (max-width: 992px) {
  .ct-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .ct-tool-section {
    padding: 20px var(--ct-sp-sm);
    min-height: auto;
  }

  .ct-layout {
    grid-template-columns: 1fr;
    gap: var(--ct-sp-md);
    max-width: 100%;
    margin: 0 auto;
  }

  .ct-tool-container {
    max-width: 100%;
    width: 100%;
  }

  .ct-card-header {
    padding: var(--ct-sp-lg) var(--ct-sp-md);
  }
  .ct-card-title {
    font-size: 23px;
  }
  .ct-card-icon {
    font-size: 26px;
  }

  .ct-card-body {
    padding: var(--ct-sp-lg) var(--ct-sp-md);
  }

  .ct-form-row.ct-cols-2,
  .ct-form-row.ct-cols-3,
  .ct-form-row.ct-cols-4 {
    grid-template-columns: 1fr;
  }

  /* Stack result grids on tablet */
  .ct-result-grid.ct-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .ct-result-grid.ct-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .ct-tabs {
    flex-wrap: wrap;
    gap: var(--ct-sp-sm);
  }

  .ct-tab {
    flex: 1;
    min-width: 70px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .ct-btn-group {
    flex-direction: column;
  }
  .ct-btn { width: 100%; justify-content: center; }

  .ct-result {
    padding: var(--ct-sp-lg) var(--ct-sp-md);
  }

  .ct-result-value {
    font-size: 24px;
  }

  .ct-detail-item {
    flex-direction: column;
    align-items   : flex-start;
    gap           : 2px;
  }
  .ct-detail-val {
    text-align: left;
  }
}

/* ≤ 480 px — extra-small */
@media (max-width: 480px) {
  .ct-tool-section {
    padding: var(--ct-sp-lg) 8px;
  }

  .ct-card-header {
    padding: var(--ct-sp-md) var(--ct-sp-sm);
  }

  .ct-card-title {
    font-size: 20px;
    margin-bottom: var(--ct-sp-sm);
  }

  .ct-card-icon {
    font-size: 32px;
    margin-bottom: 4px;
  }

  .ct-card-subtitle {
    font-size: 13px;
  }

  .ct-card-body {
    padding: var(--ct-sp-md) var(--ct-sp-sm);
  }

  .ct-form-row {
    margin-bottom: var(--ct-sp-md);
    gap: var(--ct-sp-sm);
  }

  .ct-form-group {
    gap: 4px;
  }

  .ct-label {
    font-size: 13px;
  }

  .ct-input,
  .ct-select,
  .ct-textarea {
    padding: 10px 12px;
    font-size: 14px;
  }

  .ct-input-prefix {
    font-size: 13px;
  }

  .ct-range-group {
    margin-bottom: var(--ct-sp-md);
  }

  .ct-tabs {
    gap: 4px;
  }

  .ct-tab {
    padding: 7px 8px;
    font-size: 11px;
    min-width: 55px;
  }

  .ct-result-grid.ct-cols-3,
  .ct-result-grid.ct-cols-4,
  .ct-result-grid.ct-cols-2 {
    grid-template-columns: 1fr !important;
    gap: var(--ct-sp-sm);
  }

  .ct-result-value {
    font-size: 24px;
  }

  .ct-pct-sentence {
    font-size: 16px;
    padding: 12px;
  }

  .ct-pct-inline-input .ct-input {
    width: 80px !important;
  }

  .ct-pct-inline-wide .ct-input {
    width: 110px !important;
  }

  .ct-result-summary,
  .ct-pct-answer {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .ct-result-label {
    font-size  : 10px;
    letter-spacing: .8px;
  }

  .ct-result-card {
    padding: var(--ct-sp-sm) 8px;
  }

  .ct-detail-box {
    padding: var(--ct-sp-md);
  }

  .ct-btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .ct-btn-group {
    gap: var(--ct-sp-sm);
  }

  /* Ensure all toolbox rows and many custom mini controls stack on small mobile */
  .ct-bin-modes,
  .ct-bin-op-btns,
  .ct-emi-amort-toggle,
  .ct-bmi-gauge-labels,
  .ct-cur-converter,
  .ct-cur-quick-rate,
  .ct-cur-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .ct-bin-mode,
  .ct-bin-op-btn,
  .ct-emi-view-btn,
  .ct-cur-swap-btn,
  .ct-cur-pill {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .ct-cur-panel {
    padding: 14px;
  }

  .ct-bmi-gauge-labels span {
    flex-basis: auto !important;
    min-width: 0;
    width: 100%;
  }

  /* Ensure touch targets are at least 44x44px on mobile */
  .ct-input,
  .ct-select,
  .ct-button,
  .ct-btn,
  .ct-tab {
    min-height: 44px;
  }
}

/* ≤ 360 px — very small phones */
@media (max-width: 360px) {
  .ct-tool-section {
    padding: var(--ct-sp-lg) 6px;
  }

  .ct-card-header {
    padding: var(--ct-sp-md) 8px;
  }

  .ct-card-body {
    padding: var(--ct-sp-md) 8px;
  }

  .ct-card-title {
    font-size: 18px;
  }

  .ct-card-icon {
    font-size: 28px;
  }

  .ct-input,
  .ct-select,
  .ct-textarea {
    padding: 9px 10px;
    font-size: 13px;
  }

  .ct-tab {
    padding: 6px 6px;
    font-size: 10px;
    min-width: 50px;
  }

  /* Stack all result grid columns */
  .ct-result-grid.ct-cols-2,
  .ct-result-grid.ct-cols-3,
  .ct-result-grid.ct-cols-4 {
    grid-template-columns: 1fr;
  }

  .ct-result-value {
    font-size: 20px;
  }

  .ct-result-label {
    font-size: 9px;
  }

  .ct-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  .ct-cur-swap-btn,
  .ct-bin-mode,
  .ct-bin-op-btn,
  .ct-emi-view-btn,
  .ct-cur-pill {
    font-size: 12px;
    padding: 8px 10px;
    min-height: auto;
  }

  .ct-cur-status,
  .ct-cur-panel,
  .ct-range-group,
  .ct-bmi-gauge-labels,
  .ct-detail-box,
  .ct-form-row {
    width: 100%;
    min-width: 0;
  }


  .ct-result {
    padding: var(--ct-sp-md) 8px;
  }

  .ct-result-summary {
    padding: var(--ct-sp-sm) var(--ct-sp-md);
    font-size: 13px;
  }
}

/* ----------------------------------------------------------
   21. PRINT (hide ads, simplify)
   ---------------------------------------------------------- */
@media print {
  .ct-tool-section {
    background: #fff !important;
    padding   : 0 !important;
  }
  .ct-section-bg-shapes { display: none !important; }
  .ct-card {
    box-shadow: none !important;
    border    : 1px solid #ddd !important;
  }
}
/* ----------------------------------------------------------
   LIVE AGE — pulse animation for seconds card + badge
   ---------------------------------------------------------- */
.ct-age-live-pulse {
  animation: ctLivePulse 1s ease-in-out infinite;
}

@keyframes ctLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .4); }
  50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.ct-badge-success.ct-live-dot {
  position: relative;
  padding-left: 22px;
}

.ct-badge-success.ct-live-dot::before {
  content       : '';
  position      : absolute;
  left          : 8px;
  top           : 50%;
  transform     : translateY(-50%);
  width         : 8px;
  height        : 8px;
  border-radius : 50%;
  background    : #ef4444;
  animation     : ctDotBlink 1s ease-in-out infinite;
}

@keyframes ctDotBlink {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1);   }
  50%      { opacity: .4; transform: translateY(-50%) scale(.7); }
}

/* Seconds card live border glow */
.ct-age-seconds-live {
  border-color: var(--ct-success) !important;
  background  : rgba(16, 185, 129, .06) !important;
}

.ct-age-seconds-live .ct-result-value {
  color: var(--ct-success) !important;
}
/* ============================================================
   BMI CALCULATOR — ENHANCEMENT STYLES
   Append this file to calculator-tools.css OR include it
   separately after calculator-tools.css loads.
   These rules support SEO/AEO/accessibility enhancements
   added to bmi-calculator.html.
   ============================================================ */

/* ----- Screen-reader-only utility (for sr-only class) ----- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ----- Form help text ----- */
.ct-form-help {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--ct-muted, #64748b);
  line-height: 1.5;
}

/* ----- Article meta bar (Published / Updated / Author) ----- */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 8px;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: #475569;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.article-meta-bar strong {
  color: #1e293b;
}

.article-meta-bar a {
  color: var(--ct-primary, #6366f1);
  text-decoration: none;
  font-weight: 500;
}

.article-meta-bar a:hover {
  text-decoration: underline;
}

/* ----- Quick Answer / TL;DR box (AEO optimization) ----- */
.content-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(59, 130, 246, 0.08));
  border-left: 4px solid #10b981;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.content-highlight h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: #065f46;
}

.content-highlight p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.content-highlight p:last-child {
  margin-bottom: 0;
}

/* ----- Key Takeaways box ----- */
.key-takeaways {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  color: #334155;
}

.key-takeaways h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: #1e293b;
}

.key-takeaways ul {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
}

.key-takeaways li {
  margin-bottom: 0.5rem;
}

.key-takeaways li:last-child {
  margin-bottom: 0;
}

/* ----- Table of Contents ----- */
.toc {
  background: #f1f5f9;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.125rem;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.8;
  columns: 2;
  column-gap: 2rem;
}

.toc a {
  color: var(--ct-primary, #6366f1);
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
}

/* ----- Definition box (for LLM extraction) ----- */
.definition-box {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.definition-box p {
  margin: 0;
  line-height: 1.6;
  color: #78350f;
}

/* ----- Formula box ----- */
.formula-box {
  background: #1e293b;
  color: #f1f5f9;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-family: 'Courier New', Consolas, Monaco, monospace;
  font-size: 1.05rem;
  overflow-x: auto;
  border-left: 4px solid #6366f1;
}

/* ----- Content table enhancements ----- */
.content-table-wrapper {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.content-table th {
  background: #1e293b;
  color: #fff;
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

.content-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.95rem;
}

.content-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.content-table tbody tr:hover {
  background: #eff6ff;
}

/* ----- Feature list (icon + text) enhancement ----- */
.feature-list {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.6;
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li > span:first-child {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

/* ----- Dark theme support ----- */
[data-theme="dark"] .article-meta-bar {
  background: rgba(99, 102, 241, 0.12);
  color: #cbd5e1;
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .article-meta-bar strong {
  color: #f1f5f9;
}

[data-theme="dark"] .key-takeaways {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .key-takeaways h2 {
  color: #f1f5f9;
}

[data-theme="dark"] .toc {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .toc h2 {
  color: #f1f5f9;
}

[data-theme="dark"] .definition-box {
  background: #422006;
  color: #fef3c7;
}

[data-theme="dark"] .definition-box p {
  color: #fef3c7;
}

[data-theme="dark"] .content-table {
  background: #1e293b;
}

[data-theme="dark"] .content-table th {
  background: #0f172a;
}

[data-theme="dark"] .content-table td {
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .content-table tbody tr:nth-child(even) {
  background: #0f172a;
}

[data-theme="dark"] .content-table tbody tr:hover {
  background: #1e3a5f;
}

[data-theme="dark"] .content-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.15));
}

[data-theme="dark"] .content-highlight h2 {
  color: #6ee7b7;
}

[data-theme="dark"] .feature-list li {
  border-bottom-color: #334155;
}


.accordion__content ul,
.accordion__content ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.accordion__content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.accordion__content ul {
  list-style-type: disc;
}

.accordion__content ol {
  list-style-type: decimal;
}

/* ── Responsive Amortization Table Fix ── */

/* Make the wrapper scroll horizontally instead of squishing */
.ct-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* Ensure the table never collapses below a readable width */
.ct-table {
  min-width: 480px;
  width: 100%;
  border-collapse: collapse;
}

/* Keep header text horizontal — no wrapping */
.ct-table thead th {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 13px;
}

.ct-table tbody td {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
}

/* Mobile: tighten padding and font slightly */
@media (max-width: 600px) {
  .ct-table thead th,
  .ct-table tbody td {
    padding: 8px 8px;
    font-size: 12px;
  }

  /* Optional: subtle scroll hint shadow on the right edge */
  .ct-table-wrap {
    box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.15);
  }
}
