/* Минимальная оболочка самостоятельной страницы калькулятора. */
html,
body.premial-calculator-standalone {
  min-height: 100%;
}

body.premial-calculator-standalone {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f1f1f1;
}

/*
 * Только стартовый экран проектов повторяет ширину основного сайта.
 * Рабочая область калькулятора остаётся полноширинной.
 */
#premial-profile-calculator-root.project-screen-home #project-center {
  box-sizing: border-box;
  width: min(calc(100% - 32px), 1200px);
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
}

/* Никаких внутренних колонок: обычный вертикальный поток. */
#premial-profile-calculator-root #project-home {
  display: block;
  width: 100%;
}

/* Брендинг и возврат на основной сайт в левом верхнем углу контейнера. */
#premial-profile-calculator-root .project-site-brand {
  box-sizing: border-box;
  display: flex;
  width: 250px;
  max-width: 100%;
  margin: 0 0 28px;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

#premial-profile-calculator-root .project-site-logo-link {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  line-height: 0;
  transition: opacity .16s ease, transform .16s ease;
}

#premial-profile-calculator-root .project-site-logo-link img {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
}

#premial-profile-calculator-root .project-site-return-link {
  color: #475467;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  transition: color .16s ease;
}

#premial-profile-calculator-root .project-site-logo-link:hover {
  opacity: .82;
  transform: translateY(-1px);
}

#premial-profile-calculator-root .project-site-return-link:hover {
  color: #101828;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#premial-profile-calculator-root .project-site-logo-link:focus-visible,
#premial-profile-calculator-root .project-site-return-link:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .3);
  outline-offset: 4px;
}

/* Компактная панель открытого проекта: данные проекта сразу после кнопки возврата. */
#premial-profile-calculator-root .project-workspace-bar {
  grid-template-columns: auto minmax(260px, 520px) minmax(0, 1fr) auto;
  grid-template-areas:
    "back current . actions"
    "banner banner banner banner";

  align-items: center;
  padding: 10px 14px;
}

#premial-profile-calculator-root .project-workspace-bar > .project-back {
  grid-area: back;
  align-self: center;
}

#premial-profile-calculator-root .project-workspace-bar > .project-current {
  grid-area: current;
  width: 100%;
  min-width: 0;
  align-self: center;
  justify-self: start;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
}

#premial-profile-calculator-root .project-current > label,
#premial-profile-calculator-root .project-current > input,
#premial-profile-calculator-root .project-current > strong {
  width: 100%;
  max-width: 520px;
}

#premial-profile-calculator-root .project-current > label {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
}

#premial-profile-calculator-root .project-current-status {
  display: inline-block;
  min-width: 0;
  max-width: min(32vw, 360px);
  overflow: hidden;
  color: #67717a;
  font-weight: 600;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

#premial-profile-calculator-root .project-current-status[data-tone="success"] {
  color: #22804a;
}

#premial-profile-calculator-root .project-current-status[data-tone="error"] {
  color: #b42318;
}

#premial-profile-calculator-root .project-workspace-bar > .project-workspace-actions {
  grid-area: actions;
  align-self: center;
  justify-self: end;
  align-items: center;
  justify-content: flex-end;
}

/* Исходный live-region остаётся доступным, но больше не создаёт отдельную строку. */
#premial-profile-calculator-root .project-workspace-bar > #project-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

#premial-profile-calculator-root .project-workspace-bar > .project-assortment-banner {
  grid-area: banner;
  margin-top: 10px;
}

@media (max-width: 900px) {
  #premial-profile-calculator-root .project-workspace-bar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "back"
      "current"
      "actions"
      "banner";
    gap: 10px;
  }

  #premial-profile-calculator-root .project-workspace-bar > .project-back,
  #premial-profile-calculator-root .project-workspace-bar > .project-workspace-actions {
    justify-self: center;
  }

  #premial-profile-calculator-root .project-workspace-bar > .project-current {
    align-items: center;
    justify-self: stretch;
  }

  #premial-profile-calculator-root .project-current-status {
    max-width: min(70vw, 360px);
  }
}

@media (max-width: 600px) {
  #premial-profile-calculator-root.project-screen-home #project-center {
    width: min(calc(100% - 20px), 1200px);
  }

  #premial-profile-calculator-root .project-site-brand {
    width: 210px;
    margin-bottom: 22px;
  }

  #premial-profile-calculator-root .project-site-logo-link img {
    width: 210px;
  }

  #premial-profile-calculator-root .project-workspace-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Изолируем калькулятор от глобальной подсветки активных чекбоксов шаблона сайта. */
#premial-profile-calculator-root input[type="checkbox"]:checked + span {
  background-color: transparent !important;
}

/* Печатные пресеты: отменяем глобальное width:100% у input и выравниваем чекбокс по первой строке текста. */
#premial-profile-calculator-root #ps-print-presets label.print-preset-check {
  display: grid !important;
  grid-template-columns: 16px minmax(0, 1fr) !important;
  column-gap: 8px !important;
  align-items: start !important;
  width: 100% !important;
}

#premial-profile-calculator-root #ps-print-presets label.print-preset-check > input[type="checkbox"] {
  box-sizing: border-box !important;
  display: block !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  max-height: 16px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  align-self: start !important;
  flex: none !important;
}

#premial-profile-calculator-root #ps-print-presets label.print-preset-check > span {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.35 !important;
  background: transparent !important;
}

/* Экран доступа для незарегистрированного пользователя. */
.calculator-auth-required,
.calculator-auth-required * {
  box-sizing: border-box;
}

.calculator-auth-required {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(24px, 6vw, 72px) 16px;
  place-items: center;
  color: #29333d;
  background:
    radial-gradient(circle at 50% 0, rgba(213, 50, 50, .09), transparent 38%),
    linear-gradient(180deg, #fafafa 0%, #f2f4f6 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.calculator-auth-required__card {
  width: min(100%, 620px);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 20px;
  box-shadow: 0 18px 55px rgba(35, 42, 49, .12);
}

.calculator-auth-required__brand {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  line-height: 0;
  transition: opacity .16s ease, transform .16s ease;
}

.calculator-auth-required__brand img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.calculator-auth-required__brand:hover {
  opacity: .82;
  transform: translateY(-1px);
}

.calculator-auth-required__brand:focus-visible,
.calculator-auth-required__button:focus-visible {
  outline: 3px solid rgba(213, 50, 50, .24);
  outline-offset: 4px;
}

.calculator-auth-required__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  place-items: center;
  color: #d53232;
  background: #fff1f1;
  border-radius: 50%;
}

.calculator-auth-required__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calculator-auth-required__eyebrow {
  margin: 0 0 8px;
  color: #b62b2b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calculator-auth-required h1 {
  margin: 0;
  color: #202932;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.18;
}

.calculator-auth-required__lead {
  max-width: 500px;
  margin: 16px auto 0;
  color: #67717a;
  font-size: 16px;
  line-height: 1.6;
}

.calculator-auth-required__actions {
  display: flex;
  margin-top: 30px;
  justify-content: center;
  gap: 12px;
}

.calculator-auth-required__button {
  display: inline-flex;
  min-width: 190px;
  min-height: 48px;
  padding: 12px 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.calculator-auth-required__button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.calculator-auth-required__button--primary {
  color: #fff;
  background: #d53232;
  border-color: #d53232;
  box-shadow: 0 8px 18px rgba(213, 50, 50, .2);
}

.calculator-auth-required__button--primary:hover {
  color: #fff;
  background: #b62b2b;
  border-color: #b62b2b;
}

.calculator-auth-required__button--secondary {
  color: #38434d;
  background: #fff;
  border-color: #d8dde2;
}

.calculator-auth-required__button--secondary:hover {
  color: #202932;
  background: #f5f6f7;
  border-color: #c7cdd3;
}

.calculator-auth-required__note {
  margin: 22px 0 0;
  color: #8a929a;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .calculator-auth-required {
    align-items: start;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .calculator-auth-required__card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .calculator-auth-required__brand {
    margin-bottom: 24px;
  }

  .calculator-auth-required__brand img {
    width: 190px;
  }

  .calculator-auth-required__actions {
    flex-direction: column;
  }

  .calculator-auth-required__button {
    width: 100%;
    min-width: 0;
  }
}
