@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

:root {
  --cm-local-accent: #0ea5e9;
  --font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cm-font-sans: var(--font-family);
}

html {
  scroll-behavior: smooth;
}

body.wp-theme-calcmastery_v2 {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

body.wp-theme-calcmastery_v2 :where(h1, h2, h3, h4, h5, h6, .post-content, .cm-content, .prose, .breadcrumb, .site-header, .sidebar) {
  font-family: var(--font-family);
  letter-spacing: 0;
}

body.wp-theme-calcmastery_v2 .prose :where(p, li, blockquote, figcaption, summary, td, th) {
  font-family: var(--font-family);
}

body.wp-theme-calcmastery_v2 .prose :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

body:not(.front-page) .site-main {
  padding-top: var(--header-height);
}

.site-main {
  min-height: 64vh;
}

.logo-image-dark,
[data-theme='dark'] .logo-image-light {
  display: none;
}

[data-theme='dark'] .logo-image-dark {
  display: inline-block;
}

.site-header {
  z-index: 1002;
}

.desktop-nav .menu {
  align-items: center;
}

.desktop-nav .menu a {
  text-decoration: none;
}

.hero-section {
  min-height: 560px;
}

.hero-actions,
.section-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.featured-section,
.category-directory,
.features-section,
.search-results-section {
  margin-top: clamp(36px, 6vw, 72px);
  margin-bottom: clamp(36px, 6vw, 72px);
}

.tools-grid.calculators-grid {
  align-items: stretch;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1020px;
  margin: 32px auto 0;
}

.features-grid .feature-item {
  border-radius: 8px;
}

.tool-card {
  min-height: 168px;
}

.tool-card-content {
  position: relative;
  min-height: 100%;
}

.tool-card-excerpt {
  margin: 10px 42px 0 0;
}

.archive-header {
  margin: 32px 0 34px;
}

.archive-title {
  margin-bottom: 12px;
}

.archive-description {
  max-width: 820px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-sheet,
.page-sheet,
.legal-page {
  max-width: 920px;
  margin: 0 auto clamp(48px, 8vw, 92px);
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: 12px;
  padding: clamp(22px, 4vw, 42px);
}

.content-layout .cm-entry {
  margin-bottom: clamp(36px, 6vw, 72px);
}

.post-header {
  margin-bottom: 22px;
}

.post-title {
  margin: 0 0 10px;
}

.post-short-description {
  color: var(--muted);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.post-content.cm-content {
  width: 100%;
}

.prose {
  color: var(--text);
  line-height: var(--line-height-body);
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
  line-height: var(--line-height-heading);
  margin-top: 1.8em;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose a {
  color: var(--brand);
}

.content-field {
  margin: 20px 0;
}

.content-field__label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ring);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--panel);
  color: var(--text);
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.reference-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
  padding-left: 1.1rem;
}

.reference-list li {
  margin: 0;
}

.reference-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.sidebar .related-list,
.sidebar .category-list,
.sidebar .quick-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .related-item,
.sidebar .category-item,
.sidebar .quick-links li {
  margin: 0;
  border-bottom: 1px solid var(--ring);
}

.sidebar .related-link,
.sidebar .category-link,
.sidebar .quick-links a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
}

.sidebar .related-link:hover,
.sidebar .category-link:hover,
.sidebar .quick-links a:hover {
  color: var(--brand);
}

.related-title {
  margin: 0;
  font-size: var(--font-size-base);
}

.category-directory--home {
  scroll-margin-top: 110px;
}

.directory-link {
  scroll-margin-top: 110px;
}

.cm-search-page-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  max-width: 760px;
  margin: 0 0 30px;
}

.cm-search-page-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.search-card-list {
  display: grid;
  gap: 14px;
}

.search-result-card {
  border: 1px solid var(--cardBorder);
  border-radius: 8px;
  background: var(--card);
  padding: 18px 20px;
}

.search-result-card h3 {
  margin: 0 0 8px;
}

.search-result-card a {
  color: var(--text);
  text-decoration: none;
}

.search-result-card a:hover {
  color: var(--brand);
}

.search-result-card p {
  margin: 0;
  color: var(--muted);
}

.search-results-dropdown .search-result-item,
.mobile-search-results .search-result-item {
  display: block;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--ring);
}

.search-results-dropdown .search-result-item:hover,
.mobile-search-results .search-result-item:hover,
.search-results-dropdown .search-result-item.highlighted {
  background: var(--panel);
  color: var(--brand);
}

.search-result-title {
  display: block;
  font-weight: var(--font-weight-semibold);
}

.search-result-excerpt {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-small);
}

.search-suggestions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calcmastery-gdpr-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  max-width: 980px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--cardBorder);
  border-radius: 12px
  padding: 18px;
}

.calcmastery-gdpr-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.calcmastery-gdpr-title {
  margin: 0 0 6px;
  font-size: var(--font-size-lg);
}

.calcmastery-gdpr-message {
  margin: 0;
  color: var(--muted);
}

.calcmastery-gdpr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calcmastery-gdpr-btn {
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
}

.calcmastery-gdpr-btn-accept-all {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.footer-legal button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.footer-legal button:hover {
  text-decoration: underline;
}

[data-theme='dark'] .article-sheet,
[data-theme='dark'] .page-sheet,
[data-theme='dark'] .legal-page,
[data-theme='dark'] .search-result-card,
[data-theme='dark'] .calcmastery-gdpr-banner {
}

[data-theme='dark'] .search-results-dropdown .search-result-item:hover,
[data-theme='dark'] .mobile-search-results .search-result-item:hover {
  background: rgba(148, 163, 184, 0.12);
}

.calcmastery-compat {
  color-scheme: light;
}

[data-theme='dark'] .calcmastery-compat {
  --cm-surface: #ffffff;
  --cm-surface-muted: #f8fafc;
  --cm-text: #0f172a;
  --cm-text-muted: #475569;
  --cm-border: #e2e8f0;
  --cm-border-strong: #cbd5e1;
  color: #0f172a;
}

[data-theme='dark'] .calcmastery-compat .ct.cm-card,
[data-theme='dark'] .calcmastery-compat .cm-card,
[data-theme='dark'] .calcmastery-compat .cm-calculator-card,
[data-theme='dark'] .calcmastery-compat .cm-converter-card {
  background: #ffffff !important;
  border-color: #dbe3ee !important;
  color: #0f172a !important
}

[data-theme='dark'] .calcmastery-compat .cm-card :where(h1, h2, h3, h4, p, span, div, label, li, summary),
[data-theme='dark'] .calcmastery-compat .ct.cm-card :where(h1, h2, h3, h4, p, span, div, label, li, summary) {
  color: inherit;
}

[data-theme='dark'] .calcmastery-compat .cm-field-label,
[data-theme='dark'] .calcmastery-compat .cm-description,
[data-theme='dark'] .calcmastery-compat .cm-help,
[data-theme='dark'] .calcmastery-compat .cm-detail-label {
  color: #475569 !important;
}

[data-theme='dark'] .calcmastery-compat input,
[data-theme='dark'] .calcmastery-compat select,
[data-theme='dark'] .calcmastery-compat textarea,
[data-theme='dark'] .calcmastery-compat .cm-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme='dark'] .calcmastery-compat .cm-detail-item,
[data-theme='dark'] .calcmastery-compat [data-cm='result'],
[data-theme='dark'] .calcmastery-compat [data-cm='details-content'] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme='dark'] .calcmastery-compat .cm-btn--secondary,
[data-theme='dark'] .calcmastery-compat button.cm-btn--secondary {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme='dark'] .calcmastery-gdpr-banner {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

[data-theme='dark'] .calcmastery-gdpr-title,
[data-theme='dark'] .calcmastery-gdpr-message {
  color: #e5e7eb !important;
}

[data-theme='dark'] .calcmastery-gdpr-message a {
  color: #60a5fa !important;
}

@media (max-width: 900px) {
  .cm-search-page-form {
    grid-template-columns: 1fr;
  }

  .calcmastery-gdpr-container {
    grid-template-columns: 1fr;
  }

  .calcmastery-gdpr-actions {
    justify-content: flex-start;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 520px;
  }

  .article-sheet,
  .page-sheet,
  .legal-page {
    border-radius: 8px;
    padding: 20px;
  }

  .tool-card {
    min-height: 150px;
  }
}

.calcmastery-compat,
.calcmastery-compat * {
  box-sizing: border-box;
}

.calcmastery-compat :where(.ct.cm-card, .cm-card, .cm-calculator-card, .cm-converter-card) {
  max-width: 100%;
  background: #ffffff !important;
  color: #0f172a !important;
}

.calcmastery-compat :where(.cm-input-section, .cm-input-group, .cm-input-row, .cm-calculator-body, .cm-converter-body, .cm-results-section) {
  max-width: 100%;
  min-width: 0;
}

.calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit) {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 48px;
  overflow: hidden !important;
  gap: 0 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0f172a !important;
}

.calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit):focus-within {
  border-color: #0ea5e9 !important;
  outline: 2px solid rgba(14, 165, 233, 0.36) !important;
  outline-offset: 2px;
}

.calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit) :where(.cm-input, input, textarea, select) {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: 0 !important;
}

.calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit) :where(.cm-input, input, textarea)::placeholder {
  color: #64748b !important;
  opacity: 1;
}

.calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit) :where(.cm-input, input, textarea)::selection {
  background: rgba(14, 165, 233, 0.28);
  color: #0f172a;
}

.calcmastery-compat :where(.cm-unit-label, .cm-input-prefix, .cm-input-suffix) {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px;
  padding: 0 12px !important;
  border: 0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 500;
  white-space: nowrap;
}

.calcmastery-compat .cm-dual-input.is-unit-left :where(.cm-unit-label, .cm-input-prefix):first-child,
.calcmastery-compat .cm-input-with-unit :where(.cm-unit-label, .cm-input-prefix):first-child {
  border-right: 1px solid #e2e8f0 !important;
}

.calcmastery-compat .cm-dual-input:not(.is-unit-left) :where(.cm-unit-label, .cm-input-suffix):last-child,
.calcmastery-compat .cm-input-with-unit :where(.cm-unit-label, .cm-input-suffix):last-child {
  border-left: 1px solid #e2e8f0 !important;
}

.calcmastery-compat .cm-slider-control {
  --cm-slider-progress: 0%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 0;
  background: transparent;
  color: #0f172a;
  transition: none;
}

.calcmastery-compat .cm-slider-control:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.calcmastery-compat .cm-slider {
  width: 100% !important;
  min-width: 0 !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #0ea5e9;
  cursor: pointer;
  outline: 0 !important;
  appearance: none;
  -webkit-appearance: none;
}

.calcmastery-compat .cm-slider::-webkit-slider-runnable-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #0ea5e9 0%,
    #0ea5e9 var(--cm-slider-progress),
    #e5e7eb var(--cm-slider-progress),
    #e5e7eb 100%
  );
}

.calcmastery-compat .cm-slider::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 2px solid #0ea5e9;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.calcmastery-compat .cm-slider::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #e5e7eb;
}

.calcmastery-compat .cm-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #0ea5e9;
}

.calcmastery-compat .cm-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #0ea5e9;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: none;
}

.calcmastery-compat .cm-slider-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  min-width: 56px;
  height: 34px;
  min-height: 34px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 5px 10px;
  background: #ffffff;
  color: #075985;
  box-shadow: none !important;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: 0;
  appearance: textfield;
  -moz-appearance: textfield;
}

.calcmastery-compat .cm-slider-value:focus {
  border-color: #0ea5e9;
  box-shadow: none !important;
  outline: 0;
}

.calcmastery-compat .cm-input-group--toggle {
  justify-content: flex-end;
  gap: 8px;
}

.calcmastery-compat .cm-toggle.cm-switch {
  position: relative;
  display: inline-flex !important;
  width: 88px !important;
  height: 40px !important;
  min-width: 88px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  appearance: none;
  cursor: pointer;
  vertical-align: middle;
}

.calcmastery-compat .cm-toggle.cm-switch::after {
  content: none !important;
}

.calcmastery-compat .cm-toggle.cm-switch input {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
}

.calcmastery-compat .cm-toggle.cm-switch .cm-toggle-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid #b6c7dc;
  background: #cbd5e1;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.calcmastery-compat .cm-toggle.cm-switch.is-on .cm-toggle-track {
  background: #22c55e;
  border-color: #16a34a;
  box-shadow: none;
}

.calcmastery-compat .cm-toggle.cm-switch input:focus-visible + .cm-toggle-track,
.calcmastery-compat .cm-toggle.cm-switch:focus-visible .cm-toggle-track {
  border-color: #0ea5e9;
  box-shadow: none;
}

.calcmastery-compat .cm-toggle.cm-switch .cm-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: none;
  transition: transform 0.18s ease;
}

.calcmastery-compat .cm-toggle.cm-switch.is-on .cm-toggle-knob {
  transform: translateX(48px);
}

.calcmastery-compat .cm-toggle.cm-switch .cm-toggle-text {
  position: absolute;
  top: 50%;
  z-index: 1;
  max-width: 38px;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition: opacity 0.16s ease;
}

.calcmastery-compat .cm-toggle.cm-switch .cm-toggle-text-on {
  left: 13px;
  opacity: 0;
}

.calcmastery-compat .cm-toggle.cm-switch .cm-toggle-text-off {
  right: 12px;
  color: #334155;
  opacity: 1;
}

.calcmastery-compat .cm-toggle.cm-switch.is-on .cm-toggle-text-on {
  opacity: 1;
}

.calcmastery-compat .cm-toggle.cm-switch.is-on .cm-toggle-text-off {
  opacity: 0;
}

[data-theme='dark'] .calcmastery-compat .cm-slider-control,
[data-theme='dark'] .calcmastery-compat .ct.cm-card .cm-slider-control {
  border-color: transparent;
  background: transparent;
  color: #e5e7eb;
}

[data-theme='dark'] .calcmastery-compat .cm-slider-control:focus-within,
[data-theme='dark'] .calcmastery-compat .ct.cm-card .cm-slider-control:focus-within {
  border-color: transparent;
  box-shadow: none;
}

[data-theme='dark'] .calcmastery-compat .cm-slider::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    #60a5fa 0%,
    #60a5fa var(--cm-slider-progress),
    #334155 var(--cm-slider-progress),
    #334155 100%
  );
}

[data-theme='dark'] .calcmastery-compat .cm-slider::-moz-range-track {
  background: #334155;
}

[data-theme='dark'] .calcmastery-compat .cm-slider::-moz-range-progress {
  background: #60a5fa;
}

[data-theme='dark'] .calcmastery-compat .cm-slider-value,
[data-theme='dark'] .calcmastery-compat .ct.cm-card .cm-slider-value {
  border-color: rgba(96, 165, 250, 0.34);
  background: #0f172a;
  color: #bfdbfe;
}

[data-theme='dark'] .calcmastery-compat .cm-toggle.cm-switch .cm-toggle-track {
  border-color: #64748b;
  background: #475569;
}

[data-theme='dark'] .calcmastery-compat .cm-toggle.cm-switch .cm-toggle-text-off {
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .calcmastery-compat .cm-input-group--toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
  }

  .calcmastery-compat .cm-input-group--toggle > label:first-child {
    margin-bottom: 0;
  }
}

.calcmastery-compat :where(.cm-details-list, .cm-conversion-details, .cm-details-content) {
  background: transparent !important;
}

.calcmastery-compat .cm-details-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.calcmastery-compat .cm-detail-item,
.calcmastery-compat .cm-detail-input,
.calcmastery-compat .cm-detail-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: transparent !important;
  color: #0f172a !important;
}

.calcmastery-compat .cm-detail-item:last-child {
  border-bottom: 0 !important;
}

.calcmastery-compat :where(.cm-detail-label, .cm-detail-value, .cm-result-label, .cm-result-value, [data-cm-output]) {
  color: #0f172a !important;
}

.calcmastery-compat .cm-detail-label,
.calcmastery-compat .cm-result-label {
  color: #475569 !important;
}

.calcmastery-compat .cm-scenarios-btn {
  min-width: 82px;
  white-space: nowrap;
}

.cm-entry .cm-formula,
.post-content .cm-formula,
.cm-guide-step__body .cm-formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 14px 14px 16px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  box-shadow: none;
}

.cm-entry .cm-formula__math,
.post-content .cm-formula__math,
.cm-guide-step__body .cm-formula__math {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #93c5fd transparent;
}

.cm-entry .cm-formula__math::-webkit-scrollbar,
.post-content .cm-formula__math::-webkit-scrollbar,
.cm-guide-step__body .cm-formula__math::-webkit-scrollbar {
  height: 6px;
}

.cm-entry .cm-formula__math::-webkit-scrollbar-thumb,
.post-content .cm-formula__math::-webkit-scrollbar-thumb,
.cm-guide-step__body .cm-formula__math::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #93c5fd;
}

.cm-entry .cm-formula .math-formula,
.post-content .cm-formula .math-formula,
.cm-guide-step__body .cm-formula .math-formula {
  display: block;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.65;
  text-align: left;
  white-space: nowrap;
}

.cm-entry .cm-formula .math-formula:hover,
.post-content .cm-formula .math-formula:hover,
.cm-guide-step__body .cm-formula .math-formula:hover {
  background: transparent;
  border-color: transparent;
}

.cm-entry .cm-formula .math-formula sub,
.cm-entry .cm-formula .math-formula sup,
.post-content .cm-formula .math-formula sub,
.post-content .cm-formula .math-formula sup,
.cm-guide-step__body .cm-formula .math-formula sub,
.cm-guide-step__body .cm-formula .math-formula sup {
  font-size: 0.72em;
  line-height: 0;
}

.cm-entry .math-formula--inline,
.post-content .math-formula--inline,
.cm-guide-step__body .math-formula--inline {
  display: inline;
  padding: 0 0.22em;
  border-radius: 4px;
  background: #e0efff;
  font-family: inherit;
  font-weight: 650;
  color: #0f172a;
}

.cm-formula__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #dbeafe;
  color: #1d4ed8;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.cm-formula__copy:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.cm-formula__copy:active {
  transform: translateY(1px);
}

.cm-formula__copy:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.cm-formula__copy[data-state="copied"] {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.cm-formula__copy svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cm-formula__copy-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cm-formula-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  max-width: min(320px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.cm-formula-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cm-formula-toast[data-tone="error"] {
  border-color: #fecaca;
  background: #991b1b;
}

[data-theme='dark'] .cm-entry .cm-formula,
[data-theme='dark'] .post-content .cm-formula,
[data-theme='dark'] .cm-guide-step__body .cm-formula {
  border-color: #1e40af;
  border-left-color: #60a5fa;
  background: #0b1f3f;
}

[data-theme='dark'] .cm-entry .cm-formula .math-formula,
[data-theme='dark'] .post-content .cm-formula .math-formula,
[data-theme='dark'] .cm-guide-step__body .cm-formula .math-formula {
  color: #eaf2ff;
}

[data-theme='dark'] .cm-formula__copy {
  border-color: #1e40af;
  background: #102a56;
  color: #bfdbfe;
}

[data-theme='dark'] .cm-formula__copy:hover,
[data-theme='dark'] .cm-formula__copy[data-state="copied"] {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
}

@media (max-width: 600px) {
  .cm-entry .cm-formula,
  .post-content .cm-formula,
  .cm-guide-step__body .cm-formula {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 12px;
  }

  .cm-entry .cm-formula .math-formula,
  .post-content .cm-formula .math-formula,
  .cm-guide-step__body .cm-formula .math-formula {
    font-size: 0.9rem;
  }

  .cm-formula__copy {
    width: 32px;
    height: 32px;
  }
}

.prose :where(ul, ol) {
  padding-left: 1.35rem;
}

.prose :where(li + li) {
  margin-top: 0.4rem;
}

.content-field--faq {
  margin: 34px 0 22px;
}

.content-field--faq h2,
.cm-guide-heading h2 {
  margin: 0 0 16px;
  color: var(--text);
}

.cm-faq-list,
.cm-guide-steps {
  display: grid;
  gap: 12px;
}

.cm-faq-item,
.cm-guide-step {
  border: 1px solid var(--cardBorder);
  border-radius: 8px;
  background: var(--card);
}

.cm-faq-item summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  font-weight: var(--font-weight-semibold);
}

.cm-faq-answer,
.cm-guide-step__body {
  padding: 0 16px 16px;
}

.cm-guide-step {
  padding: 16px;
}

.cm-guide-step h3 {
  margin: 0 0 10px;
  color: var(--text);
}

@media (max-width: 520px) {
  .calcmastery-compat :where(.cm-dual-input, .cm-input-with-unit) {
    min-height: 46px;
  }

  .calcmastery-compat :where(.cm-unit-label, .cm-input-prefix, .cm-input-suffix) {
    min-width: 36px;
    padding: 0 9px !important;
  }

  .calcmastery-compat .cm-detail-item,
  .calcmastery-compat .cm-detail-input,
  .calcmastery-compat .cm-detail-output {
    align-items: flex-start;
  }
}

/* Targeted review fixes for public navigation, sidebars, and imported tables. */
.site-header .header-inner {
  align-items: center;
}

.site-header .desktop-nav {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.site-header .desktop-nav .menu {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .desktop-nav .menu > li {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
}

.site-header .desktop-nav .menu > li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transform: none !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.site-header .desktop-nav .menu > li > a:hover,
.site-header .desktop-nav .menu > li > a:focus-visible,
.site-header .desktop-nav .menu > li > a[aria-expanded='true'] {
  border-color: rgba(125, 211, 252, 0.34);
  background: rgba(96, 165, 250, 0.16);
  color: #ffffff !important;
  text-decoration: none;
  transform: none !important;
}

.site-header .desktop-nav .menu > li > a:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.95);
  outline-offset: 3px;
}

.site-header .desktop-nav .menu a.has-mega .mega-caret {
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  color: currentColor;
}

.mobile-menu-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.mobile-menu-list .menu-item {
  margin: 0;
}

.mobile-menu-list .menu-item > a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 18px !important;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
}

.mobile-menu-list .menu-item > a::before,
.mobile-menu-list .menu-item > a::after {
  display: none !important;
  content: none !important;
}

.mobile-mega {
  margin-top: 8px;
}

.mobile-mega details {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: 10px;
}

.mobile-mega details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 0;
  color: #ffffff !important;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.mobile-mega details > summary::-webkit-details-marker {
  display: none;
}

.mobile-mega details > summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.mobile-mega details[open] > summary::after {
  transform: rotate(225deg);
}

.mobile-mega-grid {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.mobile-mega-col {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 12px 0 4px;
}

.mobile-mega-title {
  display: block;
  color: #ffffff !important;
  font-weight: 700;
  line-height: var(--line-height-heading);
  text-decoration: none;
}

.mobile-mega-links {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.mobile-mega-links li {
  margin: 0;
}

.mobile-mega-links a {
  display: block;
  border-left: 2px solid rgba(96, 165, 250, 0.35);
  padding: 7px 0 7px 12px;
  color: rgba(255, 255, 255, 0.86) !important;
  line-height: var(--line-height-small);
  text-decoration: none;
}

.mobile-mega-title:hover,
.mobile-mega-links a:hover,
.mobile-mega-all:hover {
  color: #ffffff !important;
  text-decoration: none;
}

.mobile-mega-links a:hover {
  border-left-color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}

.mobile-mega-all {
  display: inline-flex;
  margin-top: 14px;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
}

.mobile-menu-footer {
  justify-content: flex-start;
}

.mobile-menu-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mobile-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82) !important;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mobile-social-link:hover,
.mobile-social-link:focus-visible {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(96, 165, 250, 0.16);
  color: #ffffff !important;
  text-decoration: none;
}

.mobile-menu-footer .theme-toggle {
  margin-left: auto;
}

.sidebar .category-list {
  display: grid;
  gap: 8px;
}

.sidebar .category-item {
  border-bottom: 0;
}

.sidebar .category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  border: 1px solid var(--ring);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--text) !important;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-small);
  text-decoration: none;
}

.sidebar .category-link:hover,
.sidebar .category-link:focus-visible,
.sidebar .category-link.is-hovered {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff !important;
  text-decoration: none;
}

.sidebar .category-link:hover .category-name,
.sidebar .category-link:focus-visible .category-name,
.sidebar .category-link.is-hovered .category-name {
  color: #ffffff !important;
}

.prose .cm-table-embed {
  margin: 1.25rem 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose .cm-table-embed table {
  width: 100%;
  min-width: 640px;
  border: 1px solid var(--ring);
  border-collapse: collapse;
  background: var(--card);
}

.prose .cm-table-embed caption {
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  font-weight: 600;
}

.prose .cm-table-embed th,
.prose .cm-table-embed td {
  border: 1px solid var(--ring);
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  vertical-align: top;
}

.prose .cm-table-embed thead th {
  background: var(--panel);
  font-weight: 700;
}

.prose .cm-table-embed tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}

[data-theme='dark'] .mobile-menu-list .menu-item > a,
[data-theme='dark'] .mobile-mega details > summary,
[data-theme='dark'] .mobile-mega-title,
[data-theme='dark'] .mobile-mega-links a,
[data-theme='dark'] .mobile-mega-all {
  color: #ffffff !important;
}

[data-theme='dark'] .sidebar .category-link:hover,
[data-theme='dark'] .sidebar .category-link:focus-visible,
[data-theme='dark'] .sidebar .category-link:hover .category-name,
[data-theme='dark'] .sidebar .category-link:focus-visible .category-name {
  color: #ffffff !important;
}

/* Final UX parity overrides */
.site-header .cm-header-search-trigger {
  min-width: 300px;
  min-height: 36px;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.38);
  color: rgba(255, 255, 255, 0.86)
}

.site-header .cm-header-search-trigger:hover,
.site-header .cm-header-search-trigger:focus-visible {
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
}

.site-header .cm-header-search-trigger .site-shell-search-trigger__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header .cm-header-search-trigger .site-shell-search-trigger__shortcut {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font: inherit;
}

@media (max-width: 767px) {
  .site-header .desktop-nav,
  .site-header .desktop-search {
    display: none !important;
  }
}

.sidebar .quick-links {
  display: grid;
  gap: 8px;
}

.sidebar .quick-links li {
  border-bottom: 0;
}

.sidebar .quick-links a {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--ring);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--text) !important;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-small);
  text-decoration: none;
}

.sidebar .quick-links a:hover,
.sidebar .quick-links a:focus-visible,
.sidebar .quick-links a.is-hovered {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff !important;
  text-decoration: none;
}

body .sidebar .quick-links a:hover,
body .sidebar .quick-links a:focus-visible,
body .sidebar .quick-links a.is-hovered {
  border-color: var(--brand) !important;
  background-color: var(--brand) !important;
  background-image: none !important;
  color: #ffffff !important;
}

.sidebar .category-link:hover *,
.sidebar .category-link:focus-visible *,
.sidebar .category-link.is-hovered *,
.sidebar .quick-links a:hover *,
.sidebar .quick-links a:focus-visible *,
.sidebar .quick-links a.is-hovered * {
  color: #ffffff !important;
}

.calcmastery-compat .cm-hero {
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  background-image: none !important;
  color: #0f172a !important
}

.calcmastery-compat .cm-hero-number {
  color: #0f172a !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

.calcmastery-compat .cm-hero-category,
.calcmastery-compat .cm-scale-label,
.calcmastery-compat .cm-scale-label span,
.calcmastery-compat .cm-scale-label small {
  color: #334155 !important;
  opacity: 1 !important
}

.calcmastery-compat .cm-scale-bar {
  background: #dbe4ee !important
}

.calcmastery-compat .cm-scale-fill {
  background: #0f766e !important;
}

.calcmastery-compat :where(.cm-unit-label, .cm-input-prefix, .cm-input-suffix) {
  border-color: transparent !important;
  background: transparent !important
}

.prose .cm-table-embed,
.prose .cm-table-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.prose .cm-table-panel {
  overflow: hidden;
}

@media (max-width: 640px) {
  .prose .cm-table-embed {
    overflow-x: hidden;
  }

  .prose .cm-table-embed table {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
  }

  .prose .cm-table-embed colgroup,
  .prose .cm-table-embed thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .prose .cm-table-embed caption {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    border: 1px solid var(--ring);
    border-radius: 8px;
    background: var(--card);
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .prose .cm-table-embed tbody,
  .prose .cm-table-embed tr,
  .prose .cm-table-embed td,
  .prose .cm-table-embed th {
    display: block;
    width: 100%;
  }

  .prose .cm-table-embed tbody tr {
    margin: 0 0 12px;
    border: 1px solid var(--ring);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
  }

  .prose .cm-table-embed tbody tr:nth-child(even) {
    background: var(--card);
  }

  .prose .cm-table-embed td,
  .prose .cm-table-embed tbody th {
    display: grid;
    grid-template-columns: minmax(112px, 40%) minmax(0, 1fr);
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--ring);
    padding: 10px 12px;
    overflow-wrap: anywhere;
  }

  .prose .cm-table-embed td:last-child,
  .prose .cm-table-embed tbody th:last-child {
    border-bottom: 0;
  }

  .prose .cm-table-embed td::before,
  .prose .cm-table-embed tbody th::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
}

[data-theme='dark'] .sidebar .quick-links a:hover,
[data-theme='dark'] .sidebar .quick-links a:focus-visible,
[data-theme='dark'] .sidebar .quick-links a.is-hovered,
[data-theme='dark'] .sidebar .quick-links a:hover *,
[data-theme='dark'] .sidebar .quick-links a:focus-visible *,
[data-theme='dark'] .sidebar .quick-links a.is-hovered * {
  color: #ffffff !important;
}

body.cm-embed {
  background: #ffffff;
}

body.cm-embed .site-main {
  min-height: 0;
  padding: 0;
}

.cm-embed-frame {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 16px;
  background: #ffffff;
}

.cm-embed-frame .calcmastery-compat {
  margin: 0;
}

.cm-embed-credit {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: center;
}

.cm-embed-credit a {
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.cm-embed-credit a:hover,
.cm-embed-credit a:focus-visible {
  color: #0ea5e9;
  text-decoration: underline;
}

.calcmastery-compat [data-cm='charts-toggle'] {
  min-height: 36px;
}

.cm-charts-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 0.8125rem;
}

.cm-charts-toggle-icon,
.cm-charts-toggle-chevron svg,
.cm-share-embed-trigger svg {
  flex: 0 0 auto;
  color: currentColor;
}

.calcmastery-compat .cm-insights-header {
  margin: 22px 0 0;
  padding: 14px 16px 0;
  border: 1px solid #cbd5e1;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
}

.calcmastery-compat .cm-insights-header h4 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.calcmastery-compat .cm-insights {
  margin-top: 0 !important;
  padding: 0 16px 16px;
  border: 1px solid #cbd5e1;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #f8fafc;
}

.calcmastery-compat .cm-insight-item {
  display: grid;
  gap: 6px;
  padding: 14px 0 0;
  border-top: 1px solid #e2e8f0;
}

.calcmastery-compat .cm-insight-title {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.calcmastery-compat .cm-insight-description {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.55;
}

.cm-share-embed-trigger {
  gap: 7px;
}

.cm-share-dialog {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
}

.cm-share-dialog__panel {
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
}

.cm-share-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.cm-share-dialog__header h3 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
}

.cm-share-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  font-size: 1.25rem;
}

.cm-share-dialog__body {
  display: grid;
  gap: 10px;
}

.cm-share-dialog__label {
  display: block;
  margin: 6px 0 0;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 700;
}

.cm-share-dialog__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.cm-share-dialog__row input,
.cm-share-dialog__row textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 10px;
}

.cm-share-dialog__row textarea {
  resize: vertical;
}

.cm-share-dialog__copy,
.cm-share-dialog__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  background: #0ea5e9;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0 13px;
  text-decoration: none;
  white-space: nowrap;
}

.cm-share-dialog__social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 6px;
}

.cm-share-dialog__social a {
  min-height: 36px;
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.cm-share-copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
}

@media (max-width: 560px) {
  .cm-share-dialog__row {
    flex-direction: column;
  }

  .cm-share-dialog__copy {
    min-height: 40px;
  }
}

/* Calculator page UX refresh */
.single-cm_calculator .calculator-layout {
  display: block;
}

.single-cm_calculator .calculator-layout .main-content {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.single-cm_calculator .calculator-layout .sidebar {
  width: 100%;
  max-width: 920px;
  margin: 32px auto 0;
}

.single-cm_calculator .calculator-entry,
.single-cm_calculator .calculator-post {
  max-width: 920px;
  margin: 0 auto clamp(44px, 7vw, 84px);
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.single-cm_calculator .calculator-header {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.single-cm_calculator .calculator-header .post-title {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: 0;
}

.single-cm_calculator .calculator-header .post-short-description {
  max-width: 760px;
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.55;
}

.single-cm_calculator .calculator-primary {
  margin: 0;
}

.single-cm_calculator .calculator-primary .calcmastery-compat {
  margin: 0;
  font-family: var(--font-family);
}

.single-cm_calculator .calculator-primary .calcmastery-compat .ct.cm-card {
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.single-cm_calculator .calculator-primary .calcmastery-compat .cm-calculator-body,
.single-cm_calculator .calculator-primary .calcmastery-compat .cm-converter-body {
  margin-bottom: 0;
}

.single-cm_calculator .calculator-copy {
  margin-top: 28px;
  padding: 28px 0 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.single-cm_calculator .calculator-copy > *:first-child {
  margin-top: 0;
}

.single-cm_calculator .calculator-copy .prose:first-child h2:first-child,
.single-cm_calculator .calculator-copy .prose:first-child h3:first-child {
  margin-top: 0;
}

.calcmastery-compat :where(input, select, textarea, .cm-input, .cm-result, .cm-detail-value, .cm-hero-number, .cm-table, .cm-chart, [data-cm-output]) {
  font-variant-numeric: tabular-nums;
}

.calcmastery-compat .cm-input-group label {
  color: #0f172a !important;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0;
}

.calcmastery-compat .cm-tabs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin: 0 0 8px;
  padding: 4px;
  overflow: visible;
  border: 0 !important;
  border-radius: 8px;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.72);
}

.calcmastery-compat .cm-tabs .cm-tab,
.calcmastery-compat .cm-choice-buttons .cm-choice-btn {
  flex: 1 1 158px;
  min-width: min(100%, 142px);
  min-height: 42px;
  padding: 9px 12px !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.calcmastery-compat .cm-tabs .cm-tab:hover,
.calcmastery-compat .cm-choice-buttons .cm-choice-btn:hover {
  background: rgba(255, 255, 255, 0.68) !important;
  color: #0f172a !important;
}

.calcmastery-compat .cm-tabs .cm-tab.is-on,
.calcmastery-compat .cm-tabs .cm-tab.is-active,
.calcmastery-compat .cm-tabs .cm-tab[aria-selected='true'],
.calcmastery-compat .cm-choice-buttons .cm-choice-btn.is-on,
.calcmastery-compat .cm-choice-buttons .cm-choice-btn.is-active {
  background: #ffffff !important;
  color: #0f4a82 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(14, 165, 233, 0.22) !important;
}

.calcmastery-compat .cm-tabs .cm-tab:focus-visible,
.calcmastery-compat .cm-choice-buttons .cm-choice-btn:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.7);
  outline-offset: 2px;
}

.calcmastery-compat .cm-tab-title,
.calcmastery-compat .cm-choice-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.calcmastery-compat .cm-choice-dot {
  display: none !important;
}

.calcmastery-compat .cm-choice-help {
  margin-top: 8px;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.45;
}

.calcmastery-compat .cm-actions {
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
}

.calcmastery-compat .cm-actions .cm-btn,
.calcmastery-compat .cm-share-embed-trigger {
  min-height: 40px;
  padding: 0 15px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0f4a82 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.calcmastery-compat .cm-actions .cm-btn:hover,
.calcmastery-compat .cm-actions .cm-btn:focus-visible,
.calcmastery-compat .cm-share-embed-trigger:hover,
.calcmastery-compat .cm-share-embed-trigger:focus-visible {
  border-color: #0ea5e9 !important;
  background: #f8fafc !important;
  color: #075985 !important;
  text-decoration: none;
}

.calcmastery-compat .cm-actions .cm-btn:focus-visible,
.calcmastery-compat .cm-share-embed-trigger:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.62);
  outline-offset: 2px;
}

.site-header .hamburger-menu,
.site-header .mobile-search-toggle,
.site-header .theme-toggle {
  width: 44px;
  height: 44px;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff;
}

.site-header .hamburger-menu:hover,
.site-header .mobile-search-toggle:hover,
.site-header .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.site-header .hamburger-menu:focus-visible,
.site-header .mobile-search-toggle:focus-visible,
.site-header .theme-toggle:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.95);
  outline-offset: 3px;
}

.site-header .hamburger-line {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 2px;
  background: currentColor !important;
  box-shadow: none !important;
}

[data-theme='dark'] .single-cm_calculator .calculator-header .post-title {
  color: #e5e7eb;
}

[data-theme='dark'] .single-cm_calculator .calculator-header .post-short-description,
[data-theme='dark'] .calcmastery-compat .cm-choice-help {
  color: #cbd5e1;
}

[data-theme='dark'] .calcmastery-compat .cm-tabs {
  background: #111827;
  box-shadow: inset 0 0 0 1px rgba(51, 65, 85, 0.9);
}

[data-theme='dark'] .calcmastery-compat .cm-tabs .cm-tab,
[data-theme='dark'] .calcmastery-compat .cm-choice-buttons .cm-choice-btn {
  color: #cbd5e1 !important;
}

[data-theme='dark'] .calcmastery-compat .cm-tabs .cm-tab.is-on,
[data-theme='dark'] .calcmastery-compat .cm-tabs .cm-tab.is-active,
[data-theme='dark'] .calcmastery-compat .cm-tabs .cm-tab[aria-selected='true'],
[data-theme='dark'] .calcmastery-compat .cm-choice-buttons .cm-choice-btn.is-on,
[data-theme='dark'] .calcmastery-compat .cm-choice-buttons .cm-choice-btn.is-active {
  background: #020617 !important;
  color: #93c5fd !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(96, 165, 250, 0.34) !important;
}

@media (max-width: 768px) {
  .single-cm_calculator .calculator-entry,
  .single-cm_calculator .calculator-post {
    margin-bottom: 48px;
  }

  .single-cm_calculator .calculator-header .post-title {
    font-size: 1.75rem;
  }

  .single-cm_calculator .calculator-copy {
    margin-top: 24px;
    padding-top: 24px !important;
  }
}

@media (max-width: 520px) {
  .calcmastery-compat .cm-tabs .cm-tab,
  .calcmastery-compat .cm-choice-buttons .cm-choice-btn {
    flex-basis: 100%;
    min-width: 0;
  }

  .calcmastery-compat .cm-actions {
    align-items: stretch;
  }

  .calcmastery-compat .cm-actions .cm-btn,
  .calcmastery-compat .cm-share-embed-trigger {
    justify-content: center;
  }
}

/* Rich content and public shell cleanup */
.site-header .cm-header-search-trigger,
.site-header .cm-header-search-trigger:hover,
.site-header .cm-header-search-trigger:focus-visible {
  box-shadow: none !important;
}

.site-header .cm-header-search-trigger {
  border-color: rgba(148, 163, 184, 0.52);
  background: rgba(15, 23, 42, 0.42);
}

.site-header .cm-header-search-trigger:hover,
.site-header .cm-header-search-trigger:focus-visible {
  border-color: rgba(125, 211, 252, 0.7);
  background: rgba(15, 23, 42, 0.56);
}

.site-shell-search {
  z-index: 2400 !important;
}

.site-shell-search.is-mobile-viewport {
  align-items: stretch;
  padding: 0;
}

.site-shell-search.is-mobile-viewport .site-shell-search-surface {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.site-shell-search.is-mobile-viewport .site-shell-search-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
  align-items: center;
  min-height: 64px;
  background: var(--panel);
}

.site-shell-search.is-mobile-viewport .site-shell-search-close {
  flex: 0 0 44px;
}

.mobile-menu-list .menu-item > a {
  border-left: 0 !important;
  transform: none !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mobile-menu-list .menu-item > a:hover,
.mobile-menu-list .menu-item > a:focus-visible,
.mobile-menu-list .menu-item > a:active {
  background: rgba(96, 165, 250, 0.12);
  text-decoration: none;
  transform: none !important;
}

.mobile-mega-links a {
  border-left: 3px solid rgba(96, 165, 250, 0.38) !important;
  border-radius: 0 6px 6px 0;
  padding: 8px 10px 8px 12px;
  transform: none !important;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mobile-mega-links a:hover,
.mobile-mega-links a:focus-visible,
.mobile-mega-links a:active {
  border-left-color: #60a5fa !important;
  background: rgba(96, 165, 250, 0.12);
  text-decoration: none;
  transform: none !important;
}

.cm-category-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cm-category-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 16px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}

.cm-category-card:hover,
.cm-category-card:focus-visible {
  border-color: var(--brand);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.cm-category-card__title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.cm-category-card__description {
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.cm-category-card__meta {
  align-self: end;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.cm-category-sections,
.all-calculators-section {
  margin-top: clamp(36px, 6vw, 72px);
}

.cm-calculator-category-section {
  scroll-margin-top: 112px;
  padding: 30px 0;
  border-top: 1px solid var(--ring);
}

.cm-category-section-header {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-bottom: 18px;
}

.cm-category-section-header h2,
.cm-category-section-header p {
  margin: 0;
}

.cm-category-section-header p {
  color: var(--muted);
}

.cm-category-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cm-category-tool {
  min-width: 0;
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 16px;
  background: var(--card);
}

.cm-category-tool h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.28;
}

.cm-category-tool h3 a {
  color: var(--text);
  text-decoration: none;
}

.cm-category-tool h3 a:hover,
.cm-category-tool h3 a:focus-visible {
  color: var(--brand);
  text-decoration: none;
}

.cm-category-tool p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .cm-category-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .site-header .header-inner {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    width: 100%;
    max-width: none;
    height: var(--header-height);
    min-height: var(--header-height);
    gap: 10px;
    padding: 0 16px;
  }

  .site-header .hamburger-menu {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    display: inline-flex;
    flex: 0 0 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 0 10px;
  }

  .site-header .brand {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    justify-self: center;
    align-self: center;
    max-width: 100%;
  }

  .site-header .brand .logo {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    justify-content: center;
  }

  .site-header .brand .logo img {
    max-width: min(140px, 100%);
    height: auto;
  }

  .site-header .header-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    justify-self: end;
    white-space: nowrap;
  }

  .site-header .hamburger-menu,
  .site-header .mobile-search-toggle,
  .site-header .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .site-header .mega-panels {
    display: none !important;
  }

  .cm-category-directory-grid,
  .cm-category-tool-grid {
    grid-template-columns: 1fr;
  }

  .cm-category-card {
    min-height: 0;
  }
}

/* Nexus mobile shell parity */
html.mobile-menu-open,
body.mobile-menu-open {
  overflow: hidden;
  overscroll-behavior: contain;
}

.mobile-menu-overlay {
  z-index: 2100;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.mobile-menu-overlay.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.mobile-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2101;
  width: min(380px, calc(100vw - 20px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #101721;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translate3d(-100%, 0, 0);
  transition: transform 220ms ease;
  will-change: transform;
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav.active {
  transform: translate3d(0, 0, 0);
}

.mobile-menu-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.mobile-menu-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: var(--header-height);
  padding: 0 16px;
}

.mobile-menu-close {
  appearance: none;
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff;
  cursor: pointer;
}

.mobile-menu-close:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.08) !important;
}

.mobile-menu-close::before {
  display: none !important;
  content: none !important;
}

.site-header .hamburger-menu:hover,
.site-header .hamburger-menu:active,
.site-header .mobile-search-toggle:hover,
.site-header .mobile-search-toggle:active,
.site-header .theme-toggle:hover,
.site-header .theme-toggle:active,
.mobile-menu-close:hover,
.mobile-menu-close:active {
  transform: none !important;
}

.mobile-menu-close:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.95);
  outline-offset: 3px;
}

.mobile-menu-close svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.mobile-brand {
  grid-column: 2;
  min-width: 0;
}

.mobile-brand .logo {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
}

.mobile-brand .logo img {
  max-width: min(140px, 100%);
  height: auto;
}

.mobile-menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 420px) {
  .site-header .header-inner {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 0 12px;
    gap: 8px;
  }

  .site-header .header-actions {
    gap: 4px;
  }

  .site-header .hamburger-menu,
  .site-header .mobile-search-toggle,
  .site-header .theme-toggle,
  .mobile-menu-close {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .mobile-menu-header {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 0 12px;
  }
}

@media (max-width: 767px) {
  .mobile-menu-overlay {
    top: var(--header-height);
  }
}

/* Cash conversion cycle benchmark module */
.cm-content .cm-table-embed {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cm-content .cm-table-embed table {
  min-width: 760px;
}

.cm-ccc-benchmark {
  margin: 32px 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(45, 55, 72, 0.16);
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.cm-ccc-benchmark,
.cm-ccc-benchmark * {
  box-sizing: border-box;
}

.cm-ccc-benchmark[hidden],
.cm-ccc-benchmark [hidden] {
  display: none !important;
}

.cm-ccc-benchmark__intro {
  max-width: 760px;
  margin-bottom: 20px;
}

.cm-ccc-benchmark__eyebrow {
  margin: 0 0 6px;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cm-ccc-benchmark h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: 0;
}

.cm-ccc-benchmark__intro p:last-child {
  margin-bottom: 0;
  color: #475569;
}

.cm-ccc-benchmark__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cm-ccc-benchmark__field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.cm-ccc-benchmark__field--wide,
.cm-ccc-benchmark__actions,
.cm-ccc-benchmark__results {
  grid-column: 1 / -1;
}

.cm-ccc-benchmark label,
.cm-ccc-benchmark legend {
  color: #263445;
  font-size: 0.88rem;
  font-weight: 700;
}

.cm-ccc-benchmark input,
.cm-ccc-benchmark select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  line-height: 1.25;
  padding: 10px 12px;
}

.cm-ccc-benchmark input:focus,
.cm-ccc-benchmark select:focus {
  border-color: #0f766e;
  outline: 3px solid rgba(20, 184, 166, 0.22);
}

.cm-ccc-benchmark__fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(71, 85, 105, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.cm-ccc-benchmark__fieldset legend {
  padding: 0 6px;
}

.cm-ccc-benchmark__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cm-ccc-benchmark__actions button,
.cm-ccc-benchmark__next {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.cm-ccc-benchmark__actions button {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #ffffff;
  cursor: pointer;
  padding: 10px 14px;
}

.cm-ccc-benchmark__actions button[type="reset"] {
  border-color: rgba(71, 85, 105, 0.28);
  background: #ffffff;
  color: #263445;
}

.cm-ccc-benchmark__results {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgba(71, 85, 105, 0.18);
  border-radius: 8px;
  background: #eef6f4;
}

.cm-ccc-benchmark__error {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #b45309;
  border-radius: 6px;
  background: #fff7ed;
  color: #7c2d12;
  font-weight: 700;
}

.cm-ccc-benchmark__summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 4px solid #0f766e;
  border-radius: 6px;
  background: #ffffff;
}

.cm-ccc-benchmark__summary span {
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cm-ccc-benchmark__summary strong {
  color: #111827;
  font-size: 1rem;
  line-height: 1.45;
}

.cm-ccc-benchmark__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.cm-ccc-benchmark__metrics div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(71, 85, 105, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.cm-ccc-benchmark__metrics dt {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.cm-ccc-benchmark__metrics dd {
  margin: 0;
  color: #111827;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cm-ccc-benchmark__driver {
  margin: 0;
  color: #334155;
}

.cm-ccc-benchmark__next {
  justify-self: start;
  border: 1px solid #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
  padding: 10px 14px;
}

.cm-ccc-benchmark[data-status="much-faster-than-industry"] .cm-ccc-benchmark__summary,
.cm-ccc-benchmark[data-status="slightly-faster-than-industry"] .cm-ccc-benchmark__summary {
  border-left-color: #15803d;
}

.cm-ccc-benchmark[data-status="much-faster-than-industry"] .cm-ccc-benchmark__summary span,
.cm-ccc-benchmark[data-status="slightly-faster-than-industry"] .cm-ccc-benchmark__summary span {
  color: #15803d;
}

.cm-ccc-benchmark[data-status="slightly-slower-than-industry"] .cm-ccc-benchmark__summary,
.cm-ccc-benchmark[data-status="much-slower-than-industry"] .cm-ccc-benchmark__summary {
  border-left-color: #b45309;
}

.cm-ccc-benchmark[data-status="slightly-slower-than-industry"] .cm-ccc-benchmark__summary span,
.cm-ccc-benchmark[data-status="much-slower-than-industry"] .cm-ccc-benchmark__summary span {
  color: #b45309;
}

[data-theme="dark"] .cm-ccc-benchmark {
  border-color: rgba(148, 163, 184, 0.2);
  background: #111827;
  color: #e5e7eb;
  box-shadow: none;
}

[data-theme="dark"] .cm-ccc-benchmark h2,
[data-theme="dark"] .cm-ccc-benchmark__summary strong,
[data-theme="dark"] .cm-ccc-benchmark__metrics dd {
  color: #f8fafc;
}

[data-theme="dark"] .cm-ccc-benchmark__intro p:last-child,
[data-theme="dark"] .cm-ccc-benchmark__driver,
[data-theme="dark"] .cm-ccc-benchmark label,
[data-theme="dark"] .cm-ccc-benchmark legend {
  color: #cbd5e1;
}

[data-theme="dark"] .cm-ccc-benchmark input,
[data-theme="dark"] .cm-ccc-benchmark select,
[data-theme="dark"] .cm-ccc-benchmark__fieldset,
[data-theme="dark"] .cm-ccc-benchmark__summary,
[data-theme="dark"] .cm-ccc-benchmark__metrics div {
  border-color: rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="dark"] .cm-ccc-benchmark__results {
  border-color: rgba(148, 163, 184, 0.24);
  background: #0b1220;
}

[data-theme="dark"] .cm-ccc-benchmark__actions button[type="reset"] {
  border-color: rgba(148, 163, 184, 0.28);
  background: #0f172a;
  color: #f8fafc;
}

@media (max-width: 900px) {
  .cm-ccc-benchmark__form,
  .cm-ccc-benchmark__fieldset,
  .cm-ccc-benchmark__metrics {
    grid-template-columns: 1fr;
  }
}
