/* ═══════════════════════════════════════════════════════════
   Совместимость — layout 1:1 как in-contri.ru, палитра Omnivatic
   ═══════════════════════════════════════════════════════════ */

.ic-compat-root,
.ic-modal-wrap {
  --ic-bg: #0c1228;
  --ic-panel: #141e3e;
  --ic-panel-2: #1a2648;
  --ic-border: rgba(212, 168, 67, 0.22);
  --ic-border-strong: rgba(212, 168, 67, 0.45);
  --ic-main: var(--gold-bright, #d4a843);
  --ic-main-soft: rgba(212, 168, 67, 0.14);
  --ic-main-shadow: rgba(212, 168, 67, 0.35);
  --ic-alt: #6eb5e8;
  --ic-alt-soft: rgba(110, 181, 232, 0.14);
  --ic-text: var(--text-light, #e8dfc8);
  --ic-text-2: var(--text-mid, #a89f8a);
  --ic-text-3: var(--text-dim, #6b6355);
  --ic-radius: 12px;
  --ic-radius-sm: 8px;
  --ic-radius-round: 50%;
  --ic-gap-xs: 8px;
  --ic-gap-s: 12px;
  --ic-gap-x: 20px;
  --ic-gap-2x: 28px;
  --ic-gap-3x: 36px;
  --ic-font: 'Open Sans', 'Segoe UI', sans-serif;
  --ic-font-display: 'Cinzel', Georgia, serif;
  font-family: var(--ic-font);
  color: var(--ic-text);
}

.ic-compat-root .fx,
.ic-modal-wrap .fx { display: flex; }
.ic-compat-root .fx-hor-centered,
.ic-modal-wrap .fx-hor-centered { justify-content: center; align-items: center; }
.ic-compat-root .align-right,
.ic-modal-wrap .align-right { text-align: right; }
.ic-compat-root .push-zero,
.ic-modal-wrap .push-zero { margin: 0; }
.ic-compat-root .push-xs,
.ic-modal-wrap .push-xs { margin-bottom: var(--ic-gap-xs); }
.ic-compat-root .push-s,
.ic-modal-wrap .push-s { margin-bottom: var(--ic-gap-s); }
.ic-compat-root .push-x,
.ic-modal-wrap .push-x { margin-bottom: var(--ic-gap-x); }
.ic-compat-root .push-2x,
.ic-modal-wrap .push-2x { margin-bottom: var(--ic-gap-2x); }
.ic-compat-root .push-6x,
.ic-modal-wrap .push-6x { margin-bottom: 56px; }
.ic-compat-root .text-3,
.ic-modal-wrap .text-3 { font-size: 15px; }
.ic-compat-root .secondary-text,
.ic-modal-wrap .secondary-text { color: var(--ic-text-2); }
.ic-compat-root .micro-text,
.ic-modal-wrap .micro-text { font-size: 12px; color: var(--ic-text-3); }
.ic-compat-root .small-text,
.ic-modal-wrap .small-text { font-size: 13px; line-height: 1.55; }
.ic-compat-root .divider,
.ic-modal-wrap .divider { height: 1px; background: var(--ic-border); }

/* ── Hero + форма ── */
.ic-calculation-wrap {
  padding: calc(var(--header-h, 72px) + 32px) 16px 48px;
  background: var(--ic-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ic-calculation-title {
  text-align: center;
  margin-bottom: var(--ic-gap-2x);
  max-width: 520px;
}

.ic-calculation-title h1 {
  font-family: var(--ic-font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ic-text);
  margin: 0;
}

.ic-calculation-title h1 span {
  display: block;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 400;
  color: var(--ic-text-2);
  margin-top: 8px;
  font-family: var(--ic-font);
}

.calculation-ui {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.calculation-ui-form {
  width: 100%;
  max-width: 320px;
}

.calculation-ui-form-select {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 var(--ic-gap-x);
  padding-left: 28px;
}

.calculation-ui-form-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}

.calculation-select-female .calculation-ui-form-icon { color: var(--ic-main); }
.calculation-select-male .calculation-ui-form-icon { color: var(--ic-alt); font-size: 18px; }

.calculation-ui-form-select .ic-native-select {
  flex: 1;
  margin: 0 4px;
  min-width: 0;
  padding: 10px 28px 10px 12px;
  font-family: var(--ic-font);
  font-size: 15px;
  font-weight: 400;
  color: var(--ic-text);
  background: var(--ic-panel);
  border: 1px solid transparent;
  border-radius: var(--ic-radius-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a89f8a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calculation-select-female .ic-native-select:focus,
.calculation-select-female .ic-native-select:hover {
  border-color: var(--ic-main);
}

.calculation-select-male .ic-native-select:focus,
.calculation-select-male .ic-native-select:hover {
  border-color: var(--ic-alt);
}

.calculation-ui-form-select .ic-native-select:nth-child(2) { flex: 0 0 72px; }
.calculation-ui-form-select .ic-native-select:nth-child(3) { flex: 1 1 120px; }
.calculation-ui-form-select .ic-native-select:nth-child(4) { flex: 0 0 88px; }

.ic-compat-root .button.wide-button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--ic-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #1a1208;
  background: var(--ic-main);
  border: none;
  border-radius: var(--ic-radius-sm);
  cursor: pointer;
  box-shadow: 0 10px 16px -10px var(--ic-main-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.ic-compat-root .button.wide-button:hover {
  box-shadow: 0 4px 8px -4px var(--ic-main-shadow);
  transform: translateY(-1px);
}

.ic-compat-root .button.wide-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.ic-compat-root .button.calc-link-button {
  margin-top: var(--ic-gap-x);
  background: transparent;
  color: var(--ic-main);
  border: 1px solid var(--ic-border-strong);
  box-shadow: none;
}

.ic-compat-root .button.calc-link-button:hover {
  background: var(--ic-main-soft);
  transform: none;
}

/* ── Modal (teleport to body via JS — full-viewport overlay like in-contri) ── */
.ic-modal-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 8, 20, 0.92);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px 40px;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  visibility: hidden;
  box-sizing: border-box;
}

.ic-modal-wrap.open {
  display: flex;
  pointer-events: auto;
  visibility: visible;
}

.ic-modal-wrap *,
.ic-modal-wrap *::before,
.ic-modal-wrap *::after {
  box-sizing: border-box;
}

.ic-modal {
  position: relative;
  width: 100%;
  max-width: 990px;
  flex-shrink: 0;
  margin: auto;
  background: var(--ic-panel);
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  padding: var(--ic-gap-x) var(--ic-gap-x) 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow-x: hidden;
}

.ic-modal-wrap #ic-modal-content {
  width: 100%;
}

.ic-modal-wrap .calc-title,
.ic-modal-wrap .calc-title-name {
  text-align: center;
}

.ic-close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
}

.ic-close-modal::before,
.ic-close-modal::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--ic-text);
  transform: translate(-50%, -50%) rotate(45deg);
}

.ic-close-modal::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ic-close-modal:hover { opacity: 1; }

.ic-modal-loader {
  display: none;
  text-align: center;
  padding: 48px 0;
}

.ic-modal-loader.active { display: block; }

.ic-modal-loader::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--ic-border);
  border-top-color: var(--ic-main);
  border-radius: 50%;
  animation: icSpin 0.8s linear infinite;
}

@keyframes icSpin { to { transform: rotate(360deg); } }

/* Promo banner */
.modal-promo-banner {
  display: flex;
  align-items: center;
  color: #1a1208;
  background: var(--ic-main);
  border: 2px solid var(--ic-border-strong);
  border-radius: var(--ic-radius);
  padding: var(--ic-gap-s);
  margin-bottom: var(--ic-gap-2x);
  text-decoration: none;
  box-shadow: 4px 4px 0 0 rgba(212, 168, 67, 0.45);
  transition: background 0.2s;
}

.modal-promo-banner:hover {
  background: #e8bc5a;
  color: #1a1208;
}

.modal-promo-banner-icon {
  background: var(--ic-panel);
  border-radius: var(--ic-radius-round);
  border: 2px solid var(--ic-border-strong);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: var(--ic-gap-s);
  flex-shrink: 0;
}

.modal-promo-banner-title {
  font-size: 13px;
  line-height: 1.5;
}

.modal-promo-banner-title-main {
  display: block;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 15px;
}

.modal-promo-banner-title-sub {
  font-size: 14px;
  opacity: 0.85;
}

.modal-small-text-black { color: var(--ic-text-2); }

.ic-modal-wrap .calc-title h2 {
  font-family: var(--ic-font);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

/* Chapter */
.calc-chapter {
  display: flex;
  align-items: center;
  margin-bottom: var(--ic-gap-x);
}

.calc-chapter-line {
  flex: 1;
  height: 1px;
  background: var(--ic-border);
}

.calc-chapter-title {
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
  margin: 0 var(--ic-gap-s);
  letter-spacing: 0.12em;
  color: var(--ic-text-3);
  font-weight: 600;
}

.calc-title h2 {
  font-family: var(--ic-font);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}

.calc-title-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.calc-subtitle {
  font-size: 14px;
  color: var(--ic-text-2);
  margin: 0;
}

/* Bio top */
.calc-bio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--ic-border);
  padding: var(--ic-gap-xs);
  border-radius: var(--ic-radius);
  margin-bottom: var(--ic-gap-x);
}

.calc-bio-top-circles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.calc-bio-top-circles span {
  width: 22px;
  height: 22px;
  border: 3px solid var(--ic-panel);
  border-radius: var(--ic-radius-round);
  background: var(--ic-border);
}

.calc-bio-top-circles span:nth-child(1) { background: #fbccce; }
.calc-bio-top-circles span:nth-child(2) { background: #fde3cd; }
.calc-bio-top-circles span:nth-child(3) { background: #fff0cc; }
.calc-bio-top-circles span:nth-child(4) { background: #c6ebd8; }
.calc-bio-top-circles span:nth-child(5) { background: #cceffb; }
.calc-bio-top-circles span:nth-child(6) { background: #d5daed; }
.calc-bio-top-circles span:nth-child(7) { background: #efd6ea; }

.circle-phyz.calc-bio-top-circles span:nth-child(1) { background: #ed000a; border-color: #fbccce; box-shadow: 0 2px 12px rgba(237,0,10,.38); }
.circle-emo.calc-bio-top-circles span:nth-child(2) { background: #f47303; border-color: #fde3cd; box-shadow: 0 2px 12px rgba(237,111,0,.47); }
.circle-intel.calc-bio-top-circles span:nth-child(3) { background: #feb301; border-color: #fff0cc; box-shadow: 0 2px 12px rgba(237,190,0,.66); }
.circle-heart.calc-bio-top-circles span:nth-child(4) { background: #00a553; border-color: #c6ebd8; box-shadow: 0 2px 12px rgba(39,165,0,.44); }
.circle-creat.calc-bio-top-circles span:nth-child(5) { background: #01aded; border-color: #cceffb; box-shadow: 0 2px 12px rgba(0,123,137,.4); }
.circle-intuit.calc-bio-top-circles span:nth-child(6) { background: #2e47a4; border-color: #d5daed; box-shadow: 0 2px 12px rgba(0,38,151,.4); }
.circle-high.calc-bio-top-circles span:nth-child(7) { background: #ad3097; border-color: #efd6ea; box-shadow: 0 2px 12px rgba(145,0,142,.37); }

.calc-bio-top-headers {
  margin-left: auto;
  text-align: right;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ic-text-2);
}

/* Chakra rows */
.calc-chakre { margin-bottom: var(--ic-gap-x); }

.calc-chakre-bar {
  width: 100%;
  height: 4px;
  background: var(--ic-panel-2);
  border-radius: 4px;
  margin-bottom: var(--ic-gap-xs);
  overflow: hidden;
}

.chakre-phyz .calc-chakre-bar { background: #fbccce; }
.chakre-emo .calc-chakre-bar { background: #fde3cd; }
.chakre-intel .calc-chakre-bar { background: #fff0cc; }
.chakre-heart .calc-chakre-bar { background: #c6ebd8; }
.chakre-creat .calc-chakre-bar { background: #cceffb; }
.chakre-intuit .calc-chakre-bar { background: #d5daed; }
.chakre-high .calc-chakre-bar { background: #efd6ea; }

.calc-chakre-bar-fill {
  display: block;
  height: 4px;
  border-radius: 4px;
  background: var(--ic-border);
  max-width: 100%;
}

.chakre-phyz .calc-chakre-bar-fill { background: #ed000a; }
.chakre-emo .calc-chakre-bar-fill { background: #f47303; }
.chakre-intel .calc-chakre-bar-fill { background: #feb301; }
.chakre-heart .calc-chakre-bar-fill { background: #00a553; }
.chakre-creat .calc-chakre-bar-fill { background: #01aded; }
.chakre-intuit .calc-chakre-bar-fill { background: #2e47a4; }
.chakre-high .calc-chakre-bar-fill { background: #ad3097; }

.calc-chakre-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.calc-chakre-content-description {
  flex: 1;
  min-width: 0;
}

.calc-chakre-content-description-name {
  font-size: 15px;
  font-weight: 700;
}

.calc-chakre-content-description-subtitle {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ic-text-2);
  margin-top: 2px;
}

.calc-chakre-content-num {
  text-align: right;
  flex-shrink: 0;
}

.calc-chakre-content-num-percent {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.calc-chakre-content-num-label {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  margin-top: 4px;
}

.chakre-phyz .calc-chakre-content-num { color: #ed000a; }
.chakre-emo .calc-chakre-content-num { color: #f47303; }
.chakre-intel .calc-chakre-content-num { color: #c99200; }
.chakre-heart .calc-chakre-content-num { color: #00a553; }
.chakre-creat .calc-chakre-content-num { color: #01aded; }
.chakre-intuit .calc-chakre-content-num { color: #2e47a4; }
.chakre-high .calc-chakre-content-num { color: #ad3097; }

.chakre-hidden-label:empty { display: none; }

/* Round blocks */
.calc-round-block-title {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 0 auto calc(var(--ic-gap-s) * -0.5);
  padding: 0 var(--ic-gap-s);
  width: fit-content;
  max-width: calc(100% - 32px);
  background: var(--ic-panel);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-round-block-title span {
  text-transform: none;
  letter-spacing: normal;
}

.calc-round-block-title.calc-round-block-matrix-title {
  margin-bottom: var(--ic-gap-x);
  line-height: 1.4;
}

.calc-round-block-title.calc-round-block-matrix-title span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--ic-text-2);
  letter-spacing: 0.02em;
}

.calc-round-block-title + .calc-round-block {
  padding-top: var(--ic-gap-2x);
}

.calc-round-block-title.calc-round-block-matrix-title + .calc-round-block {
  padding-top: var(--ic-gap-2x);
  padding-bottom: var(--ic-gap-s);
}

.calc-round-block-title.calc-round-block-matrix-title + .calc-round-block .calc-desription-group {
  margin-left: calc(var(--ic-gap-s) * -1);
  margin-right: calc(var(--ic-gap-s) * -1);
  margin-top: 0;
  margin-bottom: var(--ic-gap-x);
}

.calc-round-block-title.calc-round-block-matrix-title + .calc-round-block .calc-desription-group:last-child {
  margin-bottom: 0;
}

.calc-round-block-title.calc-round-block-matrix-title + .calc-round-block .calc-desription-group .calc-description {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 calc(var(--ic-gap-xs) / 2);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.calc-round-block-subtitle {
  position: relative;
  z-index: 2;
  margin: 7px auto -22px;
  padding: 0 var(--ic-gap-xs);
  font-size: 11px;
  color: var(--ic-text-3);
  line-height: 1.5;
  background: var(--ic-panel);
  width: fit-content;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* Default: vertical stack (numerology, pythagoras scales) */
.calc-round-block {
  display: block;
  width: 100%;
  border: 1px solid var(--ic-border);
  padding: var(--ic-gap-x) var(--ic-gap-s) var(--ic-gap-s);
  border-radius: var(--ic-radius);
  margin-bottom: var(--ic-gap-x);
}

/* Horizontal row (chakra balance, zodiac elements) */
.fx.calc-round-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--ic-gap-s);
}

.calc-double-value .calc-round-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ic-gap-s);
  margin-bottom: 0;
}

.calc-double-value .calc-round-block-title {
  font-size: 11px;
  margin-bottom: 0;
  padding: 0 var(--ic-gap-xs);
}

.calc-round-block p {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.calc-chakre-balance-half {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--ic-gap-s);
}

.calc-chakre-balance-half:last-child {
  justify-content: flex-end;
}

.calc-chakre-balance-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.calc-chakre-balance-icon p { margin: 0; }
.calc-chakre-balance-icon p:last-child { color: var(--ic-text-3); font-size: 12px; }

.calc-chakre-balance-percent {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.calc-chakre-balance-half:first-child .calc-chakre-balance-percent { color: var(--ic-main); }
.calc-chakre-balance-half:last-child .calc-chakre-balance-percent { color: var(--ic-alt); }

.calc-zodiac-balance-element {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ic-panel-2);
}

.calc-zodiac-img {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: var(--ic-gap-x) auto;
  text-align: center;
  font-size: 64px;
  line-height: 1.2;
  opacity: 0.85;
}

.calc-zodiac-img img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.calc-zodiac-signs-alt {
  margin: var(--ic-gap-s) 0 var(--ic-gap-x);
  padding: var(--ic-gap-s);
  border-radius: 10px;
  background: var(--ic-panel-2);
  border: 1px solid var(--ic-border);
}

.calc-zodiac-signs-alt .fx {
  gap: var(--ic-gap-s);
  flex-wrap: wrap;
}

.calc-zodiac-signs-alt-block {
  flex: 1 1 200px;
  font-size: 13px;
  line-height: 1.45;
}

.calc-zodiac-signs-alt-block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ic-text-3);
  margin-bottom: 4px;
}

.calc-zodiac-signs-alt-text {
  margin-top: var(--ic-gap-s);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ic-text-2);
}

.calc-chakre-balance-icon img {
  flex-shrink: 0;
}

.calc-partners-line {
  width: 40px;
  height: 2px;
  background: var(--ic-border);
  margin: 0 var(--ic-gap-s);
}

.calc-zodiac-roles {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--ic-gap-x);
}

.calc-zodiac-role-female { color: var(--ic-main); font-weight: 700; font-size: 15px; }
.calc-zodiac-role-male { color: var(--ic-alt); font-weight: 700; font-size: 15px; }

.calc-description {
  background: var(--ic-panel-2);
  padding: var(--ic-gap-s);
  font-size: 14px;
  line-height: 1.6;
  border-radius: var(--ic-radius);
  min-height: auto;
  overflow: visible;
}

.calc-description p { margin: 0 0 var(--ic-gap-s); }
.calc-description p:last-child { margin-bottom: 0; }

.calc-desription-group {
  display: flex;
  gap: var(--ic-gap-xs);
  align-items: stretch;
  width: 100%;
  margin-bottom: var(--ic-gap-x);
}

.calc-desription-group:last-child {
  margin-bottom: 0;
}

.calc-desription-group .calc-description {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Numerology values row */
.calc-num-values {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0;
  margin-bottom: var(--ic-gap-xs);
}

.calc-num-values-big {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.calc-num-values > div:first-child .calc-num-values-big,
.calc-num-values > div:first-child .calc-num-values-small {
  color: var(--ic-main);
}

.calc-num-values > div:last-child .calc-num-values-big,
.calc-num-values > div:last-child .calc-num-values-small {
  color: var(--ic-alt);
  text-align: right;
}

.calc-num-values-small {
  font-size: 12px;
  width: auto;
  min-width: 30px;
  line-height: 1.2;
  height: auto;
  margin: 4px auto 0;
  opacity: 0.55;
  text-align: center;
}

.calc-num-values-line {
  flex: 1 1 auto;
  height: 2px;
  min-width: 12px;
}

.calc-num-values-line:nth-child(2) {
  background: var(--ic-main);
  margin-left: var(--ic-gap-xs);
}

.calc-num-values-line:nth-child(4) {
  background: var(--ic-alt);
  margin-right: var(--ic-gap-xs);
}

.calc-num-values-circle {
  flex-shrink: 0;
  padding: 2px;
  width: 48px;
  height: 48px;
  border-radius: var(--ic-radius-round);
  background: linear-gradient(90deg, var(--ic-main), var(--ic-alt));
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-num-values-sum {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ic-radius-round);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--ic-main);
  background: var(--ic-panel);
}

.calc-num-values-labels {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  margin-bottom: var(--ic-gap-x);
}

.calc-num-values-labels > div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.calc-num-values-labels > div:first-child {
  text-align: left;
}

.calc-num-values-labels > div:last-child {
  text-align: right;
}

.calc-num-values-labels > div:nth-child(2) {
  flex: 0 0 48px;
}

.calc-data-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 12px;
}

.calc-micro-title {
  font-size: 11px;
  color: var(--ic-text-3);
}

.calc-sub-title {
  font-size: 14px;
  font-weight: 600;
}

/* Matrix 3x3 (modern + pifagor) — in-contri uses flex-wrap 3×3, NOT grid */
.ic-modal-wrap .calc-num-matrix-dates {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 460px;
  margin: 0 auto var(--ic-gap-s);
  font-size: 13px;
  font-weight: 600;
}

.ic-modal-wrap .calc-num-matrix-dates > div:first-child {
  color: var(--ic-main);
  text-align: left;
  flex: 1;
}

.ic-modal-wrap .calc-num-matrix-dates > div:last-child {
  color: var(--ic-alt);
  text-align: right;
  flex: 1;
}

.ic-modal-wrap .calc-num-matrix-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--ic-gap-x);
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.ic-modal-wrap .fx.calc-num-matrix {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  align-content: flex-start;
  flex: 1 1 200px;
  width: 100%;
  max-width: 210px;
  min-width: 150px;
  margin: 0;
  gap: 4px;
}

.ic-modal-wrap .calc-num-matrix-wrap .calc-num-matrix:first-child .calc-num-matrix-block {
  background: var(--ic-main-soft);
}

.ic-modal-wrap .calc-num-matrix-wrap .calc-num-matrix:last-child .calc-num-matrix-block {
  background: var(--ic-alt-soft);
}

.ic-modal-wrap .fx.calc-num-matrix .calc-num-matrix-block {
  flex: 0 0 calc(33.333% - 3px);
  width: calc(33.333% - 3px);
  box-sizing: border-box;
  min-height: 56px;
  border: 1px solid var(--ic-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  overflow: hidden;
}

.ic-modal-wrap .fx.calc-num-matrix.calc-num-matrix--pifagor .calc-num-matrix-block {
  min-height: 78px;
  padding: 8px 2px;
}

.ic-modal-wrap .calc-num-matrix-block.inactive-energy { opacity: 0.4; }
.ic-modal-wrap .calc-num-matrix-block.active-energy {
  border-color: var(--ic-main);
  opacity: 1;
}

.ic-modal-wrap .calc-num-matrix-wrap .calc-num-matrix:last-child .calc-num-matrix-block.active-energy {
  border-color: var(--ic-alt);
}

.ic-modal-wrap .calc-num-matrix-energy {
  font-size: clamp(11px, 2.8vw, 15px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ic-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  text-align: center;
}

.ic-modal-wrap .calc-num-matrix-wrap .calc-num-matrix:last-child .calc-num-matrix-energy {
  color: var(--ic-alt);
}

.ic-modal-wrap .calc-num-matrix-char {
  font-size: 8px;
  color: var(--ic-text-3);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ic-modal-wrap .calc-num-matrix-char:last-child {
  opacity: 0.65;
}

/* Scenario / Arcana cards */
.calc-num-scenario,
.calc-num-arcane {
  border: 1px solid var(--ic-border);
  border-radius: var(--ic-radius);
  padding: var(--ic-gap-s);
  min-width: 140px;
  margin: 0 6px;
}

.calc-num-scenario-inner,
.calc-num-arcane-inner {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.calc-num-arcane-num,
.calc-num-scenario-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--ic-main);
}

.calc-num-arcane-name,
.calc-num-scenario-name {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.calc-num-arcane-dates {
  font-size: 11px;
  color: var(--ic-text-3);
  margin-top: 6px;
}

/* Pifagor scales */
.ic-modal-wrap .calc-double-values-group {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.ic-modal-wrap .calc-double-value {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ic-modal-wrap .calc-scales-group {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  margin: var(--ic-gap-s) 0;
}

.calc-scale-value-female {
  color: var(--ic-main);
  font-size: 24px;
  font-weight: 800;
  margin-right: var(--ic-gap-xs);
}

.calc-scale-value-male {
  color: var(--ic-alt);
  font-size: 24px;
  font-weight: 800;
  margin-left: var(--ic-gap-xs);
}

.calc-scale-bar-vert {
  width: 8px;
  height: 80px;
  margin: 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 4px;
  position: relative;
}

.calc-scale-bar-vert:nth-child(2) { background: var(--ic-main-soft); }
.calc-scale-bar-vert:nth-child(3) { background: var(--ic-alt-soft); }

.calc-scale-bar-vert-fill {
  width: 100%;
  border-radius: 4px;
  min-height: 4px;
}

.calc-scale-bar-vert:nth-child(2) .calc-scale-bar-vert-fill {
  background: linear-gradient(0deg, var(--ic-main), #e8c86a);
}

.calc-scale-bar-vert:nth-child(3) .calc-scale-bar-vert-fill {
  background: linear-gradient(0deg, var(--ic-alt), #9fd4f5);
}

.calc-chakre.calc-chakre-good .calc-chakre-bar-fill {
  background: linear-gradient(90deg, var(--ic-main), #e8c86a);
}

.calc-chakre.calc-chakre-good .calc-chakre-content-num-percent {
  color: var(--ic-main);
}

.ic-modal-wrap .calc-data-group {
  display: flex;
  justify-content: space-between;
  gap: var(--ic-gap-s);
}

.ic-modal-wrap .calc-sub-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ic-text);
}

.ic-modal-wrap .calc-num-mission-dates-sum {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 12px;
  color: var(--ic-text-3);
  padding: 4px 8px 0;
  margin-top: 4px;
  margin-bottom: var(--ic-gap-x);
  gap: 12px;
  line-height: 1.45;
  clear: both;
}

.ic-modal-wrap .calc-num-mission-dates-sum > div {
  flex: 1 1 0;
  min-width: 0;
  word-break: break-word;
}

.ic-modal-wrap .calc-num-mission-dates-sum > div:first-child { text-align: left; }
.ic-modal-wrap .calc-num-mission-dates-sum > div:last-child { text-align: right; }

.ic-modal-wrap .ghost-button,
.ic-compat-root .ghost-button {
  display: inline-block;
  margin-top: var(--ic-gap-s);
  background: transparent !important;
  border: 1px solid var(--ic-border-strong) !important;
  color: var(--ic-main) !important;
  text-decoration: none;
  text-align: center;
}

.ic-modal-wrap .calc-secondary-button,
.ic-compat-root .calc-secondary-button {
  display: block;
  margin: var(--ic-gap-x) auto 0;
  max-width: 420px;
  opacity: 0.55;
  cursor: not-allowed;
}

.ic-modal-wrap .calc-link-button {
  display: block;
  margin: var(--ic-gap-x) auto 0;
  max-width: 420px;
  text-align: center;
  text-decoration: none;
}

.calc-num-arcane-text {
  font-size: 11px;
  color: var(--ic-text-3);
  margin-top: 8px;
  line-height: 1.4;
  max-width: 140px;
}

.ic-modal-wrap .calc-faw-legend {
  justify-content: center;
  gap: var(--ic-gap-2x);
  padding: var(--ic-gap-s);
}

.ic-modal-wrap .calc-faw-legend-block {
  align-items: center;
  gap: 10px;
}

.ic-modal-wrap .calc-faw-legend-block-icon-color {
  width: 28px;
  height: 4px;
  background: var(--ic-main);
  border-radius: 2px;
}

.ic-modal-wrap .calc-faw-legend-block-icon-area {
  width: 28px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.ic-modal-wrap .calc-faw-legend-block-title {
  font-size: 12px;
  line-height: 1.35;
}

.ic-modal-wrap .calc-faw-wrap {
  display: flex;
  gap: var(--ic-gap-x);
  justify-content: center;
  flex-wrap: wrap;
}

.ic-modal-wrap .calc-faw-chart {
  flex: 1 1 320px;
  max-width: 460px;
  text-align: center;
}

.ic-modal-wrap .calc-faw-chart canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 420px;
}

@media (max-width: 768px) {
  .ic-modal-wrap {
    padding: 12px 10px 32px;
  }

  .ic-modal {
    padding: 16px 12px 24px;
    border-radius: 10px;
  }

  .ic-modal-wrap .calc-round-block-title.calc-round-block-matrix-title {
    margin: var(--ic-gap-x) auto var(--ic-gap-s);
    max-width: 100%;
    line-height: 1.35;
    font-size: 12px;
  }

  .ic-modal-wrap .calc-round-block-title.calc-round-block-matrix-title + .calc-round-block {
    padding-top: var(--ic-gap-s);
    margin-top: 0;
  }

  .ic-modal-wrap .calc-round-block-title.calc-round-block-matrix-title + .calc-round-block .calc-desription-group {
    margin-left: 0;
    margin-right: 0;
  }

  .ic-modal-wrap .calc-round-block {
    padding: var(--ic-gap-s) var(--ic-gap-xs) var(--ic-gap-s);
    overflow: visible;
  }

  .ic-modal-wrap .calc-desription-group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--ic-gap-s);
  }

  .ic-modal-wrap .calc-desription-group .calc-description,
  .ic-modal-wrap .calc-round-block-title.calc-round-block-matrix-title + .calc-round-block .calc-desription-group .calc-description {
    flex: none;
    width: 100%;
    margin: 0;
    min-height: auto;
  }

  .ic-modal-wrap .calc-data-group {
    flex-direction: column;
    gap: 12px;
  }

  .ic-modal-wrap .calc-data-group .align-right {
    text-align: left;
  }

  .ic-modal-wrap .calc-num-values {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .ic-modal-wrap .calc-num-values-big {
    font-size: 28px;
  }

  .ic-modal-wrap .calc-num-values-circle {
    width: 42px;
    height: 42px;
  }

  .ic-modal-wrap .calc-num-values-sum {
    font-size: 18px;
  }

  .ic-modal-wrap .calc-num-values-labels {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .ic-modal-wrap .calc-num-values-labels > div {
    flex: none !important;
    order: unset !important;
    text-align: center !important;
  }

  .ic-modal-wrap .calc-num-mission-dates-sum {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .ic-modal-wrap .calc-num-mission-dates-sum > div {
    text-align: center !important;
  }

  .ic-modal-wrap .calc-num-matrix-wrap {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }

  .ic-modal-wrap .fx.calc-num-matrix {
    max-width: 240px;
  }

  .ic-modal-wrap .calc-double-values-group {
    flex-direction: column;
  }

  .fx.calc-round-block {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .calc-chakre-balance-half {
    justify-content: center !important;
  }

  .ic-modal-wrap .calc-faw-wrap {
    flex-direction: column;
    align-items: center;
  }

  .ic-modal-wrap .calc-round-block-subtitle {
    margin: 4px auto var(--ic-gap-xs);
  }

  .modal-promo-banner {
    flex-direction: column;
    text-align: center;
  }

  .modal-promo-banner-icon {
    margin: 0 auto var(--ic-gap-xs);
  }
}

@media (max-width: 480px) {
  .ic-modal-wrap .calc-num-values-big {
    font-size: 24px;
  }

  .ic-modal-wrap .calc-chakre-content-num-percent {
    font-size: 22px;
  }

  .ic-modal-wrap .calc-title h2,
  .ic-modal-wrap .calc-title-name {
    font-size: 18px;
  }
}
