/* Phase24 isolated refinement candidate. Load after existing page styles.
   Activated only by ui-refinement.js on courier365.ru or explicit local preview.
   Existing typefaces, illustrations, grid and form behavior remain in place. */
html[data-c365-ui="refined"] {
  --c365-ui-blue: #244cc9;
  --c365-ui-blue-hover: #1d3fa9;
  --c365-ui-ink: #18263c;
  --c365-ui-muted: #53617a;
  --c365-ui-line: #dce3ef;
  --c365-ui-paper: #ffffff;
  --c365-ui-anchor-offset: 24px;
}

/* Two contrasting edges keep keyboard focus visible on white and blue surfaces. */
html[data-c365-ui="refined"] :where(a[href], button, input:not([type="hidden"]), select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 3px solid var(--c365-ui-blue);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--c365-ui-paper);
  scroll-margin-block: var(--c365-ui-anchor-offset) 24px;
}

html[data-c365-ui="refined"] .form__input:focus-visible,
html[data-c365-ui="refined"] .calc-grid :is(input, select):focus-visible {
  border-color: var(--c365-ui-blue);
}

html[data-c365-ui="refined"] .form__input::placeholder {
  color: var(--c365-ui-muted);
  opacity: 1;
}

/* Anchor positioning is native; no interception of links or scrolling handlers. */
html[data-c365-ui="refined"] :where(.body-wrapper section[id], main [id], .c365-content [id]) {
  scroll-margin-top: var(--c365-ui-anchor-offset);
}

/* Keep existing font families and heading hierarchy; shorten only prose lines. */
html[data-c365-ui="refined"] main article :where(p, h2, h3),
html[data-c365-ui="refined"] .c365-content :where(p, h2, h3) {
  max-width: 68ch;
}

html[data-c365-ui="refined"] :where(main article, .c365-content) p {
  line-height: 1.7;
}

html[data-c365-ui="refined"] :where(main article, .c365-content) h2 {
  margin-top: 36px;
  text-wrap: pretty;
}

html[data-c365-ui="refined"] :where(.why__text, .helper__text, .who-is__subtitle) {
  font-weight: 400;
  line-height: 1.55;
}

html[data-c365-ui="refined"] .c365-current-conditions .seo-text__subtitle {
  line-height: 1.65;
}

html[data-c365-ui="refined"] :where(main article, .c365-content, .c365-current-conditions) a:not(.cta):not(.c365-cta) {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Feedback stays on real links/buttons. Noninteractive illustrated cards do not lift. */
html[data-c365-ui="refined"] :where(.btn--blue, .cta, .c365-cta) {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

html[data-c365-ui="refined"] :where(.cta, .c365-cta) {
  min-height: 44px;
  text-decoration: none;
  box-sizing: border-box;
}

html[data-c365-ui="refined"] .navigation__link {
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

@media (hover: hover) and (pointer: fine) {
  html[data-c365-ui="refined"] .btn--blue:hover {
    background-color: var(--c365-ui-blue);
  }

  html[data-c365-ui="refined"] :where(.cta, .c365-cta):hover {
    background-color: var(--c365-ui-blue-hover);
  }

  html[data-c365-ui="refined"] .navigation__link:hover {
    text-decoration-line: underline;
  }

  html[data-c365-ui="refined"] :where(main article, .c365-content) a:not(.cta):not(.c365-cta):hover {
    text-decoration-thickness: 2px;
  }
}

html[data-c365-ui="refined"] .c365-card:focus-within {
  border-color: var(--c365-ui-blue);
}

/* Optional /vacancies/ fragment: one real link per format, same two-column grid. */
html[data-c365-ui="refined"] .c365-content a.c365-format-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-content: start;
  align-items: center;
  gap: 12px 16px;
  color: var(--c365-ui-ink);
  text-decoration: none;
  background-color: var(--c365-ui-paper);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

html[data-c365-ui="refined"] .c365-format-card .c365-format-icon {
  display: block;
  width: 56px;
  height: 56px;
  color: var(--c365-ui-blue);
}

html[data-c365-ui="refined"] .c365-format-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-c365-ui="refined"] .c365-format-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

html[data-c365-ui="refined"] .c365-format-card p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

@media (hover: hover) and (pointer: fine) {
  html[data-c365-ui="refined"] .c365-content a.c365-format-card:hover {
    border-color: var(--c365-ui-blue);
    background-color: #f5f7fc;
    box-shadow: 0 5px 14px rgba(36, 76, 201, .08);
  }
}

html[data-c365-ui="refined"] .c365-content a.c365-format-card:active {
  background-color: #eef2fc;
}

/* Existing native details/summary behavior is retained, including its disclosure marker. */
html[data-c365-ui="refined"] :where(main article, .c365-content) summary {
  min-height: 44px;
  padding-block: 8px;
  line-height: 1.45;
  box-sizing: border-box;
}

html[data-c365-ui="refined"] :where(main article, .c365-content) details[open] > summary {
  color: var(--c365-ui-blue);
}

html[data-c365-ui="refined"] .toc {
  display: block;
  background: #f5f7fc;
  padding: 12px 20px;
  border-radius: 10px;
  border-left: 3px solid var(--c365-ui-blue);
}

html[data-c365-ui="refined"] .toc ol {
  margin: 0;
  padding-left: 22px;
}

html[data-c365-ui="refined"] .toc a {
  display: inline-block;
  min-height: 32px;
  padding-block: 3px;
  box-sizing: border-box;
}

html[data-c365-ui="refined"] .toc a[aria-current="location"] {
  font-weight: 600;
  text-decoration-thickness: 2px;
}

/* Keep Russian row labels readable in the existing scrollable mobile tables. */
html[data-c365-ui="refined"] main article th[scope="row"],
html[data-c365-ui="refined"] main article thead th:first-child {
  min-width: 6.5rem;
  width: 30%;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 600px) {
  html[data-c365-ui="refined"] main article :is(th, td) {
    padding: 8px;
    font-size: 16px;
    line-height: 1.5;
  }
}

/* Only this refinement and the existing moving header are adjusted for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html[data-c365-ui="refined"] :where(.btn--blue, .cta, .c365-cta, .navigation__link, .top-header),
  html[data-c365-ui="refined"] .header #topHeader,
  html[data-c365-ui="refined"] .c365-content a.c365-format-card {
    transition: none;
  }

  html[data-c365-ui="refined"] {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  html[data-c365-ui="refined"] :where(a[href], button, input, select, textarea, summary, [tabindex="0"]):focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

/* Illustrated vacancy cards must grow with their text instead of clipping at 200/130px. */
html[data-c365-ui="refined"] #vacancies .vacancies__card {
  display: flex;
  height: auto;
  min-height: 200px;
}

html[data-c365-ui="refined"] #vacancies .card__wrap {
  flex: 1;
  width: 100%;
  height: auto;
  padding-top: 24px;
  padding-bottom: 24px;
}

html[data-c365-ui="refined"] #vacancies .card__descr {
  flex-shrink: 0;
}

@media (min-width: 901px) and (max-width: 1200px) {
  html[data-c365-ui="refined"] #vacancies .card__img-front {
    max-width: calc(100% - 240px);
  }
}

@media (min-width: 451px) and (max-width: 705px) {
  html[data-c365-ui="refined"] #vacancies .card__wrap {
    padding-right: 18px;
  }
}

/* Use one consistent photo-above-text layout across the former 414/450px gap. */
@media (max-width: 450px) {
  html[data-c365-ui="refined"] #vacancies .card__wrap {
    padding: 156px 18px 24px;
    justify-content: flex-start;
  }

  html[data-c365-ui="refined"] #vacancies .card__descr {
    max-width: none;
    margin: 0;
  }

  html[data-c365-ui="refined"] #vacancies .card__img-front {
    top: 0;
    bottom: auto;
    left: 50%;
    width: 180px;
    height: 140px;
    transform: translateX(-50%);
  }

  html[data-c365-ui="refined"] #vacancies .card__img-front img {
    height: 100%;
    object-fit: contain;
  }

  html[data-c365-ui="refined"] #vacancies .card__images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    overflow: hidden;
  }

  html[data-c365-ui="refined"] #vacancies .card__wrap::after {
    display: none;
  }
}
