/* Prediction event detail */

:root {
    --event-positive-bg: rgba(24, 201, 116, .12);
    --event-positive-bg-strong: rgba(24, 201, 116, .18);
    --event-negative-bg: rgba(228, 79, 85, .11);
    --event-negative-bg-strong: rgba(228, 79, 85, .17);
    --event-chart-height: 310px;
    --event-sidebar-width: 354px;
}

.pe-section {
    width: min(var(--pm-shell-width), calc(100% - (var(--pm-shell-gutter) * 2)));
    margin: 18px auto 72px;
}

.pe-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--event-sidebar-width);
    gap: 22px;
    align-items: start;
}

.pe-main,
.pe-sidebar {
    min-width: 0;
}

.pe-card {
    min-width: 0;
    color: var(--pm-text);
}

/* Loading and fatal state */

.pe-loader {
    display: grid;
    min-height: 560px;
    padding-top: 12px;
    grid-template-rows: auto 310px auto;
    gap: 18px;
}

.pe-loader__main {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pe-loader__icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--pm-surface-subtle);
}

.pe-loader__copy {
    display: flex;
    width: min(420px, 55vw);
    gap: 7px;
    flex-direction: column;
}

.pe-loader__copy span,
.pe-loader__copy strong,
.pe-loader__copy small,
.pe-loader__rows span {
    display: block;
    border-radius: 6px;
    background: var(--pm-surface-subtle);
}

.pe-loader__copy span { width: 82px; height: 9px; }
.pe-loader__copy strong { width: 72%; height: 24px; }
.pe-loader__copy small { width: 130px; height: 10px; }

.pe-loader__chart {
    position: relative;
    border-radius: 12px;
    background: var(--pm-surface-subtle);
    overflow: hidden;
}

.pe-loader__chart::after,
.pe-loader__rows::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.24) 44%, transparent 63%);
    transform: translateX(-100%);
    animation: eventShimmer 1.25s ease-in-out infinite;
}

html.is-dark .pe-loader__chart::after,
html.is-dark .pe-loader__rows::after,
body.is-dark .pe-loader__chart::after,
body.is-dark .pe-loader__rows::after {
    background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.035) 44%, transparent 63%);
}

.pe-loader__chart i {
    display: none;
}

.pe-loader__rows {
    position: relative;
    display: grid;
    gap: 1px;
    overflow: hidden;
}

.pe-loader__rows span {
    height: 62px;
}

.pe-error {
    display: grid;
    min-height: 52vh;
    color: var(--pm-text-secondary);
    place-items: center;
    font-size: 13px;
    text-align: center;
}

/* Event header and chart */

.pe-head {
    padding: 4px 0 0;
}

.pe-head__top {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 12px;
}

.pe-head__icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: contain;
    flex: 0 0 52px;
}

.pe-head__info {
    min-width: 0;
    flex: 1;
}

.pe-head__breadcrumb {
    min-height: 15px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-head__title {
    margin: 2px 0 0;
    color: var(--pm-text);
    font-size: 28px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.22;
}

.pe-head__meta {
    margin-top: 5px;
    color: var(--pm-text-muted);
    font-size: 13px;
    font-weight: var(--pm-weight-medium);
}

.pe-head__actions {
    display: flex;
    gap: 4px;
}

.pe-icon-btn {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--pm-text-secondary);
    place-items: center;
    cursor: pointer;
    transition: background-color var(--pm-duration-fast) ease,
                color var(--pm-duration-fast) ease;
}

.pe-icon-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

@media (hover: hover) {
    .pe-icon-btn:hover {
        background: var(--pm-surface-hover);
        color: var(--pm-text);
    }
}

.pe-price-row {
    display: flex;
    margin: 18px 0 8px 64px;
    gap: 34px;
    flex-wrap: wrap;
}

.pe-price-box {
    min-width: 116px;
}

.pe-price-box span {
    display: block;
    margin-bottom: 3px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    text-transform: uppercase;
}

.pe-price-box strong {
    color: var(--pm-text);
    font-size: 19px;
    font-weight: var(--pm-weight-medium);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    transition: color var(--pm-duration-normal) ease;
}

.pe-price-box small {
    display: inline-block;
    margin-left: 5px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-price-box strong.is-up,
.pe-price-box small.is-up {
    color: var(--pm-green);
}

.pe-price-box strong.is-down,
.pe-price-box small.is-down {
    color: var(--pm-red);
}

.pe-legend {
    display: flex;
    min-height: 27px;
    margin-top: 18px;
    gap: 14px;
    color: var(--pm-text-secondary);
    align-items: center;
    overflow-x: auto;
    font-size: 12px;
    scrollbar-width: none;
    white-space: nowrap;
}

.pe-legend::-webkit-scrollbar {
    display: none;
}

.pe-legend__dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
}

.pe-chart-wrap {
    position: relative;
    width: 100%;
    height: var(--event-chart-height);
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
}

.pe-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.pe-chart-guide,
.pe-chart-target {
    position: absolute;
    z-index: 3;
    inset-inline: 0;
    border-top: 1px dashed var(--pm-line-strong);
    pointer-events: none;
}

.pe-chart-target span {
    position: absolute;
    right: 8px;
    top: -16px;
    color: var(--pm-text-muted);
    font-size: 12px;
}

.pe-chart-tooltip {
    position: absolute;
    z-index: 8;
    min-width: 128px;
    padding: 8px 10px;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    background: var(--pm-popover-bg);
    box-shadow: var(--pm-shadow-popover);
    color: var(--pm-text);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%);
    transition: opacity var(--pm-duration-fast) ease;
}

.pe-chart-tooltip.is-visible {
    opacity: 1;
}

.pe-chart-tooltip__row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.pe-chart-tooltip__row + .pe-chart-tooltip__row {
    margin-top: 4px;
}

.pe-chart-tooltip__name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-chart-loading {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: flex;
    background: var(--pm-surface-subtle);
    align-items: center;
    justify-content: center;
    gap: 5px;
    overflow: hidden;
}

.pe-chart-loading::after {
    content: "Loading market history";
    margin-left: 8px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-chart-loading span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pm-green);
    animation: eventDot 900ms ease-in-out infinite;
}

.pe-chart-loading span:nth-child(2) { animation-delay: 120ms; }
.pe-chart-loading span:nth-child(3) { animation-delay: 240ms; }
.pe-chart-loading i { display: none; }

.pe-chart-footer {
    display: flex;
    min-height: 44px;
    padding: 8px 0 0;
    border-top: 1px solid var(--pm-line-soft);
    color: var(--pm-text-muted);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
}

.pe-chart-footer > [data-pe-chart-vol] {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: var(--pm-text-secondary);
    font-weight: var(--pm-weight-medium);
}

.pe-chart-tabs {
    display: flex;
    gap: 3px;
}

.pe-chart-tabs button {
    min-width: 36px;
    height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-chart-tabs button.is-active {
    background: var(--pm-green-soft);
    color: var(--pm-green);
}

.pe-window-tabs {
    display: flex;
    min-height: 38px;
    margin-top: 4px;
    gap: 6px;
    align-items: center;
}

.pe-window-tabs button {
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: var(--pm-control-bg);
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-window-dot,
.pe-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--pm-red);
    box-shadow: 0 0 0 3px var(--pm-red-soft);
}

/* Market rows */

.pe-rows-card {
    margin-top: 8px;
    border-top: 1px solid var(--pm-line-soft);
}

.pe-rows {
    display: flex;
    flex-direction: column;
}

.pe-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px 300px;
    min-height: 76px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pm-line-soft);
    gap: 14px;
    align-items: center;
}

.pe-row.has-icon {
    grid-template-columns: 42px minmax(0, 1fr) 78px 300px;
}

.pe-row__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
}

.pe-avatar {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    background: var(--pe-avatar-bg, var(--pm-control-bg));
    color: #fff;
    font-size: 12px;
    font-weight: var(--pm-weight-bold);
    line-height: 1;
}

.pe-avatar > span {
    position: relative;
    z-index: 1;
}

.pe-avatar img {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pe-row__info {
    min-width: 0;
}

.pe-row__name {
    overflow: hidden;
    color: var(--pm-text);
    font-size: 14px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-row__vol {
    display: flex;
    margin-top: 3px;
    color: var(--pm-text-muted);
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-inline-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.pe-inline-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pe-row__pct {
    color: var(--pm-text);
    font-size: 23px;
    font-weight: var(--pm-weight-semibold);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pe-row__btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pe-row__btn {
    display: flex;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
    transition: background-color var(--pm-duration-fast) ease,
                border-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.pe-row__btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-row__btn strong {
    flex: 0 0 auto;
    font-weight: inherit;
    font-variant-numeric: tabular-nums;
}

.pe-row__btn--yes {
    background: var(--event-positive-bg);
    color: var(--pm-green);
}

.pe-row__btn--no {
    background: var(--event-negative-bg);
    color: var(--pm-red);
}

.pe-row__btn--yes.is-selected {
    border-color: var(--pm-green-border);
    background: var(--event-positive-bg-strong);
}

.pe-row__btn--no.is-selected {
    border-color: var(--pm-red-border);
    background: var(--event-negative-bg-strong);
}

.pe-row__btn:active {
    transform: scale(.985);
}

/* Order book and supporting content */

.pe-orderbook,
.pe-social {
    margin-top: 22px;
    border-top: 1px solid var(--pm-line-soft);
}

.pe-orderbook__toggle {
    display: flex;
    width: 100%;
    min-height: 50px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pm-text);
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-orderbook__toggle svg {
    width: 15px;
    height: 15px;
    margin-left: auto;
    fill: currentColor;
    transition: transform var(--pm-duration-normal) ease;
}

.pe-orderbook__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.pe-orderbook__vol {
    color: var(--pm-green);
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-orderbook__body {
    padding-bottom: 14px;
}

.pe-ob-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pe-ob-summary > div,
.pe-ob-depth {
    padding: 10px;
    border-radius: 9px;
    background: var(--pm-surface-subtle);
}

.pe-ob-depth__head,
.pe-ob-level {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 28px;
    color: var(--pm-text-secondary);
    align-items: center;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.pe-ob-depth__head {
    color: var(--pm-text-muted);
    font-weight: var(--pm-weight-semibold);
}

.pe-ob-level {
    position: relative;
}

.pe-ob-level__bar {
    position: absolute;
    z-index: -1;
    inset-block: 2px;
    opacity: .13;
}

.pe-ob-row__bid { color: var(--pm-green); }
.pe-ob-row__ask { color: var(--pm-red); }
.pe-ob-empty { padding: 18px; color: var(--pm-text-muted); font-size: 12px; text-align: center; }

.pe-rules {
    display: none;
}

.pe-subtabs {
    display: flex;
    min-height: 44px;
    border-bottom: 1px solid var(--pm-line-soft);
    gap: 18px;
    align-items: end;
}

.pe-subtabs button {
    position: relative;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-subtabs button.is-active {
    color: var(--pm-text);
}

.pe-subtabs button.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--pm-green);
}

.pe-social__panel {
    padding-top: 14px;
}

.pe-comment-form {
    padding: 10px;
    border-radius: 10px;
    background: var(--pm-surface-subtle);
}

.pe-comment-form__input {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 0;
    border: 0;
    outline: 0;
    resize: vertical;
    background: transparent;
    color: var(--pm-text);
    font-size: 12px;
    line-height: 1.45;
}

.pe-comment-form__input::placeholder {
    color: var(--pm-text-muted);
}

.pe-comment-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pe-comment-form__limit {
    color: var(--pm-text-muted);
    font-size: 12px;
}

.pe-comment-form__submit,
.pe-comment-guest button {
    min-width: 68px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: var(--pm-green);
    color: var(--pm-text-on-brand);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-comment-guest {
    display: flex;
    min-height: 58px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--pm-surface-subtle);
    color: var(--pm-text-secondary);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.pe-comments-list,
.pe-activity-list {
    display: flex;
    margin-top: 8px;
    flex-direction: column;
}

.pe-comment,
.pe-activity-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 58px;
    padding: 9px 0;
}

.pe-comment + .pe-comment,
.pe-activity-row + .pe-activity-row {
    border-top: 1px solid var(--pm-line-soft);
}

.pe-comment__avatar,
.pe-comment__avatar-placeholder,
.pe-activity-row__avatar,
.pe-holder-row__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.pe-comment__avatar-placeholder,
.pe-activity-row__avatar,
.pe-holder-row__avatar {
    display: grid;
    background: var(--pm-green-soft);
    color: var(--pm-green);
    place-items: center;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-comment__body,
.pe-activity-row__text {
    min-width: 0;
    color: var(--pm-text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.pe-comment__name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--pm-text);
    font-weight: var(--pm-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-comment__content {
    min-width: 0;
}

.pe-comment__header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pe-comment__header .pe-comment__name {
    flex: 1;
}

.pe-comment__delete {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pm-text-muted);
    cursor: pointer;
    place-items: center;
    transition: color .16s ease, background-color .16s ease;
}

.pe-comment__delete svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pe-comment__delete:hover {
    background: var(--pm-red-soft);
    color: var(--pm-red);
}

.pe-comment__date,
.pe-activity-row__time {
    margin-top: 3px;
    color: var(--pm-text-muted);
    font-size: 12px;
}

.pe-outcome-select {
    height: 34px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--pm-line);
    border-radius: 8px;
    background: var(--pm-control-bg);
    color: var(--pm-text-secondary);
    font-size: 12px;
}

.pe-holders-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.pe-holders-col__title {
    margin-bottom: 6px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    text-transform: uppercase;
}

.pe-holder-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 42px;
    align-items: center;
}

.pe-holder-row__avatar {
    width: 30px;
    height: 30px;
}

.pe-holder-row__name {
    overflow: hidden;
    color: var(--pm-text-secondary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-holder-row__amount {
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    font-variant-numeric: tabular-nums;
}

/* Trading sidebar */

.pe-sidebar {
    position: sticky;
    top: 104px;
    display: flex;
    gap: 14px;
    flex-direction: column;
}

.pe-sidebar-toggle {
    display: none;
}

.pe-trade,
.pe-related {
    position: relative;
    padding: 16px;
    border: 1px solid var(--pm-line-soft);
    border-radius: 14px;
    background: var(--pm-surface);
    box-shadow: var(--pm-shadow-card);
}

html.is-dark .pe-trade,
html.is-dark .pe-related,
body.is-dark .pe-trade,
body.is-dark .pe-related {
    background: #1a1f23;
}

.pe-guest-overlay {
    position: absolute;
    z-index: 30;
    inset: 0;
    display: flex;
    border-radius: inherit;
    background: rgba(255, 255, 255, .64);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--pm-text-secondary);
    text-align: center;
}

html.is-dark .pe-guest-overlay,
body.is-dark .pe-guest-overlay {
    background: rgba(18, 22, 25, .64);
}

.pe-guest-overlay svg {
    width: 27px;
    height: 27px;
    color: var(--pm-green);
    fill: currentColor;
}

.pe-guest-overlay p {
    margin: 8px 0 12px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-guest-overlay button {
    min-width: 76px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--pm-green);
    color: var(--pm-text-on-brand);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-trade__head {
    display: flex;
    min-width: 0;
    gap: 10px;
    align-items: center;
}

.pe-trade__head img {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    object-fit: contain;
    flex: 0 0 40px;
}

.pe-trade__head-text {
    min-width: 0;
}

.pe-trade__title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 13px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pe-trade__outcome-label {
    margin-top: 2px;
    color: var(--pm-green);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-trade__bar {
    display: flex;
    min-height: 44px;
    margin-top: 10px;
    border-bottom: 1px solid var(--pm-line-soft);
    align-items: center;
    justify-content: space-between;
}

.pe-trade__sides {
    display: flex;
    height: 44px;
    gap: 15px;
}

.pe-trade__sides button {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-trade__sides button.is-active {
    color: var(--pm-text);
}

.pe-trade__sides button.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--pm-green);
}

.pe-order-type {
    position: relative;
}

.pe-order-type__trigger {
    display: flex;
    min-height: 32px;
    padding: 0 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pm-text-secondary);
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

.pe-order-type__trigger svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.pe-order-type__menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 5px);
    right: 0;
    min-width: 120px;
    padding: 5px;
    border: 1px solid var(--pm-line);
    border-radius: 10px;
    background: var(--pm-popover-bg);
    box-shadow: var(--pm-shadow-popover);
    animation: eventMenuIn 180ms var(--pm-ease-emphasized) both;
}

.pe-order-type__menu button {
    display: block;
    width: 100%;
    height: 32px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pm-text-secondary);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

@media (hover: hover) {
    .pe-order-type__menu button:hover {
        background: var(--pm-surface-hover);
        color: var(--pm-text);
    }
}

.pe-trade__outcomes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.pe-trade__outcomes button {
    display: flex;
    min-width: 0;
    height: 58px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.pe-trade__outcomes button span,
.pe-trade__outcomes button small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-trade__outcomes button span {
    font-size: 13px;
    font-weight: var(--pm-weight-semibold);
}

.pe-trade__outcomes button small {
    margin-top: 2px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-trade__outcomes .outcome-a {
    background: var(--event-positive-bg);
    color: var(--pm-green);
}

.pe-trade__outcomes .outcome-b {
    background: var(--event-negative-bg);
    color: var(--pm-red);
}

.pe-trade__outcomes button.is-selected {
    border-color: currentColor;
}

.pe-trade__outcomes button:active {
    transform: scale(.985);
}

.pe-trade__panel {
    padding-top: 14px;
}

.pe-trade__row,
.pe-trade__field,
.pe-trade__preview-row,
.pe-trade__limit-preview > div,
.pe-position-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pe-trade__row,
.pe-trade__field {
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.pe-trade__cash {
    font-weight: var(--pm-weight-semibold);
}

.pe-trade__amount-input,
.pe-trade__shares-input {
    width: 100%;
    height: 68px;
    margin-top: 3px;
    padding: 0 6px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pm-text);
    font-size: 36px;
    font-weight: var(--pm-weight-medium);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pe-trade__amount-input::-webkit-inner-spin-button,
.pe-trade__shares-input::-webkit-inner-spin-button {
    appearance: none;
}

.pe-trade__presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.pe-trade__presets button,
.pe-onetap-grid button {
    min-width: 0;
    height: 36px;
    padding: 0 5px;
    border: 1px solid var(--pm-line);
    border-radius: 8px;
    background: transparent;
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
}

@media (hover: hover) {
    .pe-trade__presets button:hover,
    .pe-onetap-grid button:hover {
        border-color: var(--pm-green-border);
        color: var(--pm-green);
    }
}

.pe-trade__towin,
.pe-trade__limit-preview {
    display: grid;
    margin-top: 12px;
    padding: 10px 0 0;
    border-top: 1px solid var(--pm-line-soft);
    gap: 6px;
    overflow: hidden;
    animation: eventPreviewIn 240ms var(--pm-ease-emphasized) both;
}

.pe-trade__preview-row,
.pe-trade__limit-preview > div,
.pe-position-summary__row {
    color: var(--pm-text-secondary);
    font-size: 12px;
}

.pe-trade__preview-row span {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pe-trade__preview-row svg {
    width: 12px;
    height: 12px;
}

.pe-trade__preview-row strong,
.pe-trade__limit-preview strong {
    color: var(--pm-green);
    font-size: 14px;
    font-weight: var(--pm-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.pe-trade__preview-row--muted strong {
    color: var(--pm-text);
}

.pe-trade__submit {
    width: 100%;
    height: 50px;
    margin-top: 14px;
    border: 0;
    border-radius: 9px;
    background: var(--pm-green);
    color: var(--pm-text-on-brand);
    font-size: 14px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
    transition: background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.pe-trade__submit.side-sell {
    background: var(--pm-red);
    color: #fff;
}

.pe-trade__submit:active {
    transform: scale(.99);
}

.pe-stepper {
    display: grid;
    width: 150px;
    height: 38px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    background: var(--pm-control-bg);
    overflow: hidden;
}

.pe-stepper button,
.pe-stepper__input {
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pm-text-secondary);
    text-align: center;
    font-size: 12px;
}

.pe-trade__shares-input {
    width: 150px;
    height: 38px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--pm-line);
    border-radius: 9px;
    background: var(--pm-control-bg);
    font-size: 14px;
}

.pe-onetap-label {
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.pe-onetap-cash-row {
    display: flex;
    margin: 7px 0 10px;
    color: var(--pm-text-muted);
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.pe-onetap-cash-row button {
    border: 0;
    background: transparent;
    color: var(--pm-green);
    font-size: 12px;
    cursor: pointer;
}

.pe-onetap-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.pe-trade__terms {
    margin-top: 12px;
    color: var(--pm-text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.pe-trade__terms a {
    color: var(--pm-green);
}

.pe-open-orders,
.pe-position-summary {
    display: grid;
    margin-top: 12px;
    gap: 6px;
}

.pe-open-order {
    display: flex;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--pm-surface-subtle);
    color: var(--pm-text-secondary);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
}

.pe-open-order__cancel {
    border: 0;
    background: transparent;
    color: var(--pm-red);
    font-size: 12px;
    cursor: pointer;
}

.pe-position-summary {
    padding: 10px;
    border-radius: 9px;
    background: var(--pm-surface-subtle);
}

.pe-position-summary__pnl.positive { color: var(--pm-green); }
.pe-position-summary__pnl.negative { color: var(--pm-red); }

/* Related markets */

.pe-related {
    padding: 16px;
}

.pe-related__head {
    display: flex;
    min-height: 34px;
    color: var(--pm-text);
    align-items: center;
    font-size: 13px;
    font-weight: var(--pm-weight-semibold);
}

.pe-related__head span {
    display: flex;
    gap: 7px;
    align-items: center;
}

.pe-related__head svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    color: var(--pm-green);
}

.pe-related__list {
    display: flex;
    margin-top: 3px;
    flex-direction: column;
}

.pe-related-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 60px;
    border-top: 1px solid var(--pm-line-soft);
    color: var(--pm-text-secondary);
    align-items: center;
    text-decoration: none;
}

.pe-related-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
}

.pe-related-item__body {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pe-related-skeleton {
    height: 42px;
    border-radius: 8px;
    background: var(--pm-surface-subtle);
}

@keyframes eventShimmer { to { transform: translateX(100%); } }
@keyframes eventDot {
    0%, 100% { opacity: .35; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}
@keyframes eventMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes eventPreviewIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */

@media (max-width: 1120px) {
    :root {
        --event-sidebar-width: 326px;
        --event-chart-height: 290px;
    }

    .pe-layout {
        gap: 16px;
    }

    .pe-row {
        grid-template-columns: minmax(0, 1fr) 68px 260px;
    }

    .pe-row.has-icon {
        grid-template-columns: 38px minmax(0, 1fr) 68px 260px;
    }
}

@media (max-width: 920px) {
    :root {
        --event-chart-height: 280px;
    }

    .pe-layout {
        grid-template-columns: minmax(0, 1fr) 304px;
    }

    .pe-row,
    .pe-row.has-icon {
        grid-template-columns: minmax(0, 1fr) 56px;
    }

    .pe-row.has-icon {
        grid-template-columns: 36px minmax(0, 1fr) 56px;
    }

    .pe-row__btns {
        grid-column: 1 / -1;
    }

    .pe-row.has-icon .pe-row__btns {
        grid-column: 2 / -1;
    }
}

@media (max-width: 760px) {
    :root {
        --pm-shell-gutter: 14px;
        --event-chart-height: 248px;
    }

    .pe-section {
        margin-top: 12px;
    }

    .pe-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pe-main {
        display: contents;
    }

    .pe-head { order: 1; }
    .pe-sidebar { order: 2; }
    .pe-rows-card { order: 3; }
    .pe-orderbook { order: 4; }
    .pe-rules { order: 5; }
    .pe-social { order: 6; }

    .pe-sidebar {
        position: static;
        scroll-margin-top: 98px;
    }

    .pe-sidebar-toggle {
        display: flex;
        width: 100%;
        height: 38px;
        padding: 0 12px;
        border: 0;
        border-radius: 9px;
        background: var(--pm-surface-subtle);
        color: var(--pm-text-secondary);
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        font-weight: var(--pm-weight-semibold);
        cursor: pointer;
    }

    .pe-sidebar-toggle svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
        transition: transform var(--pm-duration-normal) ease;
    }

    .pe-sidebar.is-collapsed .pe-sidebar-toggle svg {
        transform: rotate(-90deg);
    }

    .pe-sidebar.is-collapsed .pe-trade,
    .pe-sidebar.is-collapsed .pe-related {
        display: none;
    }

    .pe-trade,
    .pe-related {
        border-color: var(--pm-line-soft);
    }

    .pe-head__icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .pe-head__title {
        font-size: 20px;
    }

    .pe-price-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin: 15px 0 5px;
        gap: 10px;
    }

    .pe-price-box {
        min-width: 0;
    }

    .pe-price-box strong {
        font-size: 15px;
    }

    .pe-chart-wrap {
        margin-inline: calc(var(--pm-shell-gutter) * -1);
        width: calc(100% + (var(--pm-shell-gutter) * 2));
        border-radius: 0;
    }

    .pe-row,
    .pe-row.has-icon {
        min-height: 64px;
        padding-block: 8px;
    }

    .pe-holders-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pe-head__actions {
        gap: 1px;
    }

    .pe-icon-btn {
        width: 31px;
        height: 31px;
    }

    .pe-head__title {
        font-size: 18px;
    }

    .pe-head__breadcrumb,
    .pe-head__meta {
        font-size: 12px;
    }

    .pe-price-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pe-price-box:last-child {
        grid-column: 1 / -1;
    }

    .pe-chart-footer {
        align-items: flex-end;
    }

    .pe-chart-tabs {
        gap: 0;
    }

    .pe-chart-tabs button {
        min-width: 31px;
        padding-inline: 5px;
    }

    .pe-row__pct {
        font-size: 18px;
    }

    .pe-row__btn {
        height: 42px;
    }

    .pe-trade {
        padding: 14px;
    }

    .pe-trade__outcomes button {
        height: 54px;
    }

    .pe-trade__amount-input {
        font-size: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pe-loader__chart::after,
    .pe-loader__rows::after,
    .pe-chart-loading span,
    .pe-trade__towin,
    .pe-trade__limit-preview {
        animation: none;
    }
}

.pe-section [hidden] {
    display: none;
}
