.pc-icon {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: middle;
}

.pc-order-details,
.pc-order-details__hero,
.pc-order-details__body,
.pc-order-details__section,
.pc-order-details__title,
.pc-order-details__place,
.pc-order-details__facts > div {
    min-width: 0;
}

.pc-order-details__title > p,
.pc-order-details__place strong,
.pc-order-details__facts dd,
.pc-order-details__declarations strong,
.pc-order-timeline__content p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pc-order-details__title > p {
    max-width: 72ch;
}

.pc-order-details__place strong {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

@media (max-width: 620px) {
    .pc-order-details__place strong {
        -webkit-line-clamp: 4;
    }
}

/* KEYBOARD_FOCUS_V1: document links are not lost during keyboard navigation. */
.pc-order-details a:focus-visible {
    outline: 3px solid var(--pc-focus-ring, rgba(255, 115, 16, .32));
    outline-offset: 3px;
    border-radius: 4px;
}

.pc-order-details {
    min-width: 0;
    color: #183149;
    font-family: inherit;
}

.pc-order-details__hero {
    display: grid;
    gap: 24px;
    padding: 28px 32px 26px;
    border-bottom: 1px solid #dde7ed;
    background:
        radial-gradient(circle at 92% -10%, rgba(255, 116, 23, .12), transparent 35%),
        linear-gradient(145deg, #f7fafc 0%, #fff 70%);
}

.pc-order-details__title > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.pc-order-details__title h2 {
    margin: 0;
    color: #132c43;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.08;
}

.pc-order-details__title > p {
    margin: 8px 0 0;
    color: #657989;
    font-size: 14px;
}

.pc-order-details__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.pc-order-details__labels > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid #dce7ed;
    border-radius: 999px;
    color: #3c5b70;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, .82);
}

.pc-order-details__route {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, .9fr) minmax(150px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px 0 2px;
}

.pc-order-details__place {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.pc-order-details__place.is-destination {
    text-align: right;
}

.pc-order-details__place small,
.pc-order-details__facts dt,
.pc-order-timeline__content > span {
    color: #718496;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.pc-order-details__place strong {
    overflow: hidden;
    color: #1d3b52;
    font-size: 16px;
    white-space: normal; /* длинные названия переносятся, как в карточке заказа; обрезку даёт line-clamp выше */
}

.pc-order-details__rail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e9650d;
}

.pc-order-details__rail > span:not(.pc-order-details__transport) {
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, #9eb1be, #ffb27d);
}

.pc-order-details__transport {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #ffd2b3;
    border-radius: 13px;
    color: #e9650d;
    background: #fff8f3;
}

.pc-order-details__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 34px;
    padding: 8px 32px 32px;
    background: #fff;
}

.pc-order-details__section {
    min-width: 0;
    padding: 24px 0;
    border-bottom: 1px solid #e7eef2;
}

.pc-order-details__section h3 {
    margin: 0 0 18px;
    color: #17364d;
    font-size: 17px;
    line-height: 1.25;
}

.pc-order-details__section--timeline,
.pc-order-details__section--declarations {
    grid-column: 1 / -1;
}

.pc-order-details__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 22px;
    margin: 0;
}

.pc-order-details__facts > div {
    min-width: 0;
}

.pc-order-details__facts dt {
    margin-bottom: 5px;
}

.pc-order-details__facts dd {
    overflow-wrap: anywhere;
    margin: 0;
    color: #29485f;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.pc-order-timeline {
    position: relative;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Соединительная линия рисуется от центра значка до центра следующего значка,
   поэтому у последнего события нет хвоста, даже если его текст выше значка. */
.pc-order-timeline li:not(:last-child)::before {
    position: absolute;
    top: 27px;
    left: 18px;
    width: 2px;
    height: 100%;
    content: "";
    background: var(--pc-line, #dce7ed);
}

.pc-order-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
    gap: 13px;
    min-width: 0;
    padding: 9px 0 16px;
}

.pc-order-timeline__icon {
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #badfcd;
    border-radius: 50%;
    color: #18704d;
    background: #f1faf5;
}

.pc-order-timeline li.is-current .pc-order-timeline__icon {
    border-color: #ffb27d;
    color: #df5f08;
    background: #fff6f0;
    box-shadow: 0 0 0 5px rgba(255, 116, 23, .09);
}

.pc-order-timeline li.is-planned .pc-order-timeline__icon {
    border-color: #d6e1e7;
    color: #6d8291;
    background: #f7f9fa;
}

.pc-order-timeline__content {
    min-width: 0;
    padding-top: 1px;
}

.pc-order-timeline strong {
    display: block;
    margin-top: 3px;
    color: #26465d;
    font-size: 14px;
}

.pc-order-timeline p {
    margin: 4px 0 0;
    color: #6d7f8e;
    font-size: 12px;
    line-height: 1.4;
}

.pc-order-timeline time {
    padding-top: 9px;
    color: #657b8b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pc-order-details__declarations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 9px;
}

.pc-order-details__declaration {
    min-width: 0;
}

.pc-order-details__declaration-status {
    margin: 7px 0 0;
    color: var(--pc-text-muted, #526478);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.pc-order-details__declarations a {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid #dfe8ed;
    border-radius: 12px;
    color: #24455d;
    text-decoration: none;
    background: #f8fafb;
    transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.pc-order-details__declarations a:hover {
    border-color: #ffb27d;
    color: #17364e;
    background: #fff8f3;
}

.pc-order-details__declarations a > .pc-icon {
    color: #e9650d;
}

.pc-order-details__declarations a strong {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-order-details__declarations a > span:last-child {
    margin-left: auto;
    font-size: 17px;
}

@media (max-width: 780px) {
    .pc-order-details__hero,
    .pc-order-details__body {
        padding-right: 18px;
        padding-left: 18px;
    }

    .pc-order-details__body,
    .pc-order-details__facts {
        grid-template-columns: 1fr;
    }

    .pc-order-details__route {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .pc-order-details__place.is-destination {
        text-align: left;
    }

    .pc-order-details__rail {
        width: 42px;
        height: 52px;
        flex-direction: column;
    }

    .pc-order-details__rail > span:not(.pc-order-details__transport) {
        width: 2px;
        min-height: 6px;
        flex: 1;
        background: linear-gradient(#9eb1be, #ffb27d);
    }

    .pc-order-timeline li {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .pc-order-timeline time {
        grid-column: 2;
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pc-order-details__declarations a {
        transition: none;
    }
}

/* ORDER_DETAILS_ALIGNMENT_V2_20260809
   Matches the calculation details dialog and keeps dense business data readable. */
.pc-order-details__hero {
    display: grid;
    gap: 18px;
    padding: 24px 24px 18px;
    border-bottom: 0;
    background: #fff;
}

.pc-order-details__title {
    display: grid;
    gap: 6px;
}

.pc-order-details__kicker {
    color: #d85c00;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.pc-order-details__title h2 {
    max-width: calc(100% - 58px);
    color: #142f46;
    font-size: clamp(24px, 3vw, 30px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.pc-order-details__labels {
    margin-top: 6px;
}

.pc-order-details__labels > span {
    min-height: 28px;
    padding: 5px 10px;
    border-color: #dce7ee;
    color: #36566d;
    background: #f5f8fa;
}

.pc-order-details__route {
    gap: 14px;
    padding: 15px;
    border: 1px solid #dbe8ef;
    border-radius: 14px;
    background: #edf6fb;
}

.pc-order-details__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 24px 24px;
    background: #fff;
}

.pc-order-details__section {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 17px;
    border: 1px solid #dee8ee;
    border-radius: 16px;
    background: linear-gradient(145deg, #fff, #f8fbfd);
}

.pc-order-details__section h3 {
    margin: 0;
    font-size: 15px;
}

.pc-order-details__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pc-order-details__facts > div {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid #e0e9ef;
    border-radius: 12px;
    background: #f9fbfc;
}

.pc-order-details__facts dt {
    margin: 0;
    color: #6c7f8f;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.pc-order-details__facts dd {
    color: #142f46;
    font-size: 13px;
    line-height: 1.35;
}

.pc-order-details__section--timeline,
.pc-order-details__section--declarations {
    grid-column: 1 / -1;
}

@media (max-width: 780px) {
    .pc-order-details__hero {
        padding: 22px 18px 16px;
    }

    .pc-order-details__body,
    .pc-order-details__facts {
        grid-template-columns: 1fr;
    }

    .pc-order-details__body {
        padding: 0 18px 18px;
    }

    .pc-order-details__title h2 {
        max-width: calc(100% - 48px);
    }
}


/* ORDER_DETAILS_WINDOW_V1 */
.k-window:has(> .k-window-content > .pc-order-details) {
    width: min(1040px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(10, 31, 49, 0.28);
}

.k-window:has(> .k-window-content > .pc-order-details) > .k-window-titlebar {
    position: absolute;
    z-index: 5;
    top: 16px;
    right: 16px;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.k-window:has(> .k-window-content > .pc-order-details) .k-window-title {
    display: none;
}

.k-window:has(> .k-window-content > .pc-order-details) .k-window-titlebar-actions {
    margin: 0;
}

/* Кнопка закрытия окна заказа наследует общий вид из dialog-controls.css. */

.k-window:has(> .k-window-content > .pc-order-details) > .k-window-content {
    max-height: calc(100dvh - 48px);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: auto;
}

.k-window:has(> .k-window-content > .pc-order-details) > .k-resize-handle {
    display: none;
}

@media (max-width: 780px) {
    .k-window:has(> .k-window-content > .pc-order-details) {
        top: auto !important;
        right: 10px !important;
        bottom: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none;
        max-height: calc(100dvh - 16px);
        border-radius: 20px;
        transform: none !important;
    }

    .k-window:has(> .k-window-content > .pc-order-details) > .k-window-titlebar {
        top: 10px;
        right: 10px;
    }

    .k-window:has(> .k-window-content > .pc-order-details) > .k-window-content {
        max-height: calc(100dvh - 16px);
    }
}
