@scope (.px-market) {
  .predicta-event-card {position:relative;isolation:isolate}
  .predicta-event-card .px-story::after {content:"";position:absolute;inset:0}
  .predicta-event-card .predicta-option-list,.predicta-all-options,.predicta-focus-market {position:relative}
  .predicta-option-list {list-style:none;margin:8px 0;padding:0}
  .predicta-option-list a {display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:36px}
  .predicta-option-list strong {font-variant-numeric:tabular-nums;white-space:nowrap}
  .predicta-all-options {display:inline-flex;align-items:center;min-height:36px;color:var(--orange)}
  .px-focus .predicta-option-list {max-width:24rem}
  .predicta-event-card .px-card-info time {display:inline-flex;align-items:center;gap:5px}
  .predicta-round-clock {
    display:inline-flex; align-items:center; justify-content:flex-end; gap:4px;
    inline-size:10em; max-inline-size:100%; white-space:nowrap; font-variant-numeric:tabular-nums;
  }
  .predicta-option-list strong,.fc-choices .fc-odds {min-inline-size:5.5ch;font-variant-numeric:tabular-nums}
  .predicta-market-dialog {max-height:calc(100dvh - 28px);overflow:auto;overscroll-behavior:contain}
  .predicta-market-dialog .pl-field,.predicta-market-dialog .fc-choices {margin-block:12px}
  .predicta-market-dialog form {display:grid;gap:8px}
  .predicta-market-actions {display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
  /* D09 mode B: player matching panel. Bars animate as orders fill. */
  .mx-panel {display:grid;gap:10px;margin-top:14px}
  .mx-panel>.pl-note {margin:0;font-size:12.5px;line-height:1.6}
  .mx-offer {display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding:10px 12px;border-radius:calc(10px*var(--pr,1));background:color-mix(in srgb,var(--text) 5%,transparent)}
  .mx-offer strong {font-size:18px;font-variant-numeric:tabular-nums;color:var(--orange)}
  .mx-offer small,.mx-orders small {color:var(--muted,var(--pc-a1a1aa,#a1a1aa));font-size:12px}
  .mx-min {display:flex;align-items:center;justify-content:space-between;gap:12px}
  .mx-min-input {display:inline-flex;align-items:center;gap:4px}
  .mx-min-input input {inline-size:6em;text-align:right;font-variant-numeric:tabular-nums}
  .mx-min-input em {font-style:normal;color:var(--muted,var(--pc-a1a1aa,#a1a1aa))}
  .mx-orders {list-style:none;margin:6px 0 0;padding:0;display:grid;gap:10px}
  .mx-orders li {display:grid;gap:6px;padding:12px;border-radius:calc(10px*var(--pr,1));background:color-mix(in srgb,var(--text) 4%,transparent);animation:mx-in .26s cubic-bezier(.2,.8,.2,1)}
  .mx-order-head {display:flex;justify-content:space-between;gap:10px;font-size:14px}
  .mx-order-head span {color:var(--muted,var(--pc-a1a1aa,#a1a1aa))}
  .mx-orders li[data-status="OPEN"] .mx-order-head span,.mx-orders li[data-status="PARTIAL"] .mx-order-head span {color:var(--orange)}
  .mx-order-bar {block-size:5px;border-radius:999px;background:color-mix(in srgb,var(--text) 10%,transparent);overflow:hidden}
  .mx-order-bar i {display:block;block-size:100%;background:var(--orange);border-radius:inherit;transition:inline-size .5s cubic-bezier(.2,.8,.2,1)}
  .mx-fill {font-size:13px;color:var(--text);font-variant-numeric:tabular-nums}
  @keyframes mx-in {from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
  @media (prefers-reduced-motion:reduce){.mx-orders li{animation:none}.mx-order-bar i{transition:none}}
  /* D12: price updates and slow confirmations are status, not failure. Container change animates in. */
  .predicta-flow-status {margin:10px 0 4px;padding:9px 12px;border-radius:calc(10px*var(--pr,1));background:color-mix(in srgb,var(--orange) 10%,transparent);color:var(--text,inherit);font-variant-numeric:tabular-nums;animation:predicta-flow-status-in .26s cubic-bezier(.2,.8,.2,1)}
  @keyframes predicta-flow-status-in {from{opacity:0;transform:translateY(-4px);max-height:0;padding-block:0}to{opacity:1;transform:none;max-height:80px}}
  @media (prefers-reduced-motion:reduce){.predicta-flow-status{animation:none}}
  .predicta-market-dialog .pl-row {min-height:34px}
  .predicta-market-dialog time {font-variant-numeric:tabular-nums}
  .predicta-event-card a:focus-visible {outline:2px solid var(--orange);outline-offset:2px}
  @media(max-width:760px){.predicta-event-card .predicta-option-list a {flex-wrap:wrap;gap:3px}.px-grid .px-card.predicta-event-card h2 {line-height:1.3}}
}

@scope (.px-market) {
  .predicta-event-card {display:flex;flex-direction:column;min-width:0}
  .predicta-event-card .px-card-title {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
  .predicta-event-card .predicta-option-list {flex:1}
  .predicta-event-card .predicta-option-list a span {min-width:0;overflow-wrap:anywhere}
  .predicta-event-card .predicta-option-list strong {flex-shrink:0}
  .pl-marketgrid:has(.predicta-event-card) {grid-auto-rows:1fr}
}

@scope (.px-market) {
  .predicta-stake-entry {margin-block:20px}
  .predicta-market-dialog .predicta-stake-entry .pl-field {gap:10px;margin:0 0 10px;font-size:14px;color:var(--text)}
  .predicta-stake-entry input {display:block;width:100%;min-width:0;min-height:58px;padding:14px 16px;border:0;border-radius:calc(8px*var(--pr,1));background:var(--surface-control);color:var(--text);font-family:inherit;font-size:22px;font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums}
  .predicta-stake-entry input::placeholder {color:var(--muted);font-size:15px;font-weight:400;opacity:1}
  .predicta-stake-entry input:focus-visible,.predicta-stake-shortcuts button:focus-visible {outline:2px solid var(--orange);outline-offset:3px}
  .predicta-stake-shortcuts {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .predicta-stake-shortcuts button {min-height:44px;padding:8px;border:0;border-radius:calc(7px*var(--pr,1));background:var(--surface-control);color:var(--text);font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
  .predicta-stake-shortcuts button:hover:not(:disabled),.predicta-stake-shortcuts button[aria-pressed=true] {color:var(--orange)}
  .predicta-stake-shortcuts button:disabled,.predicta-stake-entry input:disabled {opacity:.5;cursor:not-allowed}
  .predicta-stake-balance {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .predicta-stake-shortcuts .predicta-stake-clear {color:var(--muted);font-weight:400}
  .predicta-stake-entry .pl-note {margin-top:10px;font-size:12.5px;line-height:1.6;color:var(--muted)}
}

/* Approved detail refinement: shared Predicta palette, no transaction changes. */
@scope (.px-market) {
 .predicta-topic-dialog {width:min(960px,calc(100vw - 48px));max-height:calc(100dvh - 48px);padding:24px;background:var(--panel)}
 .predicta-topic-dialog .px-dialog-top {margin-bottom:22px}
 .predicta-topic-dialog .px-dialog-top h2 {font-size:15px;font-weight:500;color:var(--muted)}
 .predicta-topic-dialog .px-dialog-top button {width:40px;height:40px;flex:none}
 .predicta-topic-layout {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:28px;align-items:start}
 .predicta-topic-context,.predicta-topic-order {min-width:0}
 .predicta-topic-image {aspect-ratio:16/9;overflow:hidden;border-radius:calc(10px*var(--pr,1));background:var(--surface-control)}
 .predicta-topic-image img {display:block;width:100%;height:100%;object-fit:cover;filter:none}
 .predicta-topic-meta {display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:18px;color:var(--muted);font-size:12.5px;line-height:1.6}
 .predicta-topic-dialog .predicta-topic-title {font-size:25px;line-height:1.4;margin:9px 0 20px;overflow-wrap:anywhere}
 .predicta-topic-rules {font-size:13px;line-height:1.7;color:var(--muted)}
 .predicta-topic-rules summary {cursor:pointer;color:var(--text);font-size:14px;font-weight:600;min-height:32px}
 .predicta-topic-rules p {margin:5px 0 14px;overflow-wrap:anywhere}
 .predicta-topic-source {margin-top:16px}
 .predicta-topic-source>span {font-size:12px;color:var(--muted)}
 .predicta-topic-source p {font-size:12.5px;margin:5px 0}
 .predicta-topic-order {padding:22px;border-radius:calc(12px*var(--pr,1));background:var(--surface-raised)}
 .predicta-topic-order>h3 {font-size:17px;margin:0 0 15px}
 .predicta-topic-order .fc-choices {display:flex;width:100%;margin:0}
 .predicta-topic-order .fc-market-option {flex:1;min-width:0;min-height:54px}
 .predicta-topic-order .predicta-quote-note {font-size:12px;line-height:1.6;margin:12px 0 24px}
 .predicta-topic-order .predicta-stake-entry {margin:0}
 .predicta-topic-order .predicta-stake-entry .pl-field {display:grid;gap:10px;font-size:14px;margin:0 0 12px}
 .predicta-topic-order .predicta-stake-entry input {min-height:64px;padding:14px 16px;font-size:26px;background:var(--panel);border-radius:calc(9px*var(--pr,1));box-shadow:none}
 .predicta-topic-order .predicta-stake-shortcuts {grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .predicta-topic-order .predicta-stake-shortcuts button {min-height:40px;padding:8px 4px;border-radius:calc(7px*var(--pr,1));font-size:13px;background:var(--panel);color:var(--text);transition:background .15s,color .15s}
 .predicta-topic-order .predicta-stake-shortcuts button:hover:not(:disabled) {background:var(--surface-control);color:var(--orange)}
 .predicta-stake-footer {display:flex;justify-content:space-between;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin-top:4px}
 .predicta-stake-footer .predicta-stake-clear {min-height:40px;padding:4px 0;color:var(--muted);font-size:12px;background:none}
 .predicta-stake-footer .predicta-stake-clear:hover:not(:disabled) {color:var(--text)}
 .predicta-stake-footer .predicta-stake-clear:disabled {opacity:.4;cursor:not-allowed}
 .predicta-topic-order .predicta-stake-entry .pl-note {font-size:12px;margin:12px 0 20px}
 .predicta-topic-order .predicta-stake-balance {justify-content:space-between;font-size:12.5px;margin:18px 0 16px}
 .predicta-topic-submit>.pl-btn {display:flex;justify-content:center;width:100%;min-height:48px;font-size:14px}
 .predicta-topic-feedback {margin:14px 0 0;font-size:13px}
 @media(max-width:700px) {
  .predicta-topic-dialog {inset:0;margin:0;width:100%;max-width:none;height:100dvh;max-height:100dvh;border-radius:0;padding:0 18px max(20px,env(safe-area-inset-bottom));overflow:auto}
  .predicta-topic-dialog .px-dialog-top {position:sticky;top:0;z-index:2;margin:0 -18px 16px;padding:12px 18px;background:var(--panel)}
  .predicta-topic-layout {grid-template-columns:1fr;gap:22px}
  .predicta-topic-image {aspect-ratio:2/1}
  .predicta-topic-dialog .predicta-topic-title {font-size:22px;margin-bottom:15px}
  .predicta-topic-meta {margin-top:14px;font-size:12px}
  .predicta-topic-order {padding:18px}
  .predicta-topic-rules p {font-size:13px}
 }
}


/* Detail v2: persistent local draft and readable information hierarchy. */
@scope (.px-market) {
 .px-focus-controls>button {min-width:38px;height:38px}
 .px-focus-controls>button svg {width:26px;height:26px;stroke-width:2.5}
 .predicta-topic-dialog {width:min(1024px,calc(100vw - 48px));padding:24px}
 .predicta-topic-layout {grid-template-columns:minmax(0,1.2fr) minmax(320px,1fr);gap:28px}
 .predicta-topic-dialog .predicta-topic-title {font-size:26px;font-weight:650;line-height:1.4;margin:10px 0 24px}
 .predicta-topic-rules h4 {font-size:14px;font-weight:600;color:var(--text);margin:0 0 12px}
 .predicta-rule-copy {display:grid;gap:10px}
 .predicta-topic-rules .predicta-rule-copy p {margin:0;font-size:13px;line-height:1.85;color:var(--muted)}
 .predicta-topic-source {margin-top:22px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
 .predicta-topic-source h4 {width:100%;margin:0}
 .predicta-topic-source a {font-size:12.5px;color:var(--text);overflow-wrap:anywhere;text-decoration:none;text-underline-offset:4px;line-height:1.8}
 .predicta-topic-order {position:sticky;top:0;padding:24px}
 .predicta-order-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px}
 .predicta-topic-dialog .predicta-order-heading h3 {font-size:19px;margin:0;font-weight:650}
 .predicta-order-heading .predicta-round-clock {font-size:12px;color:var(--muted);width:auto}
 .predicta-topic-order>h4 {font-size:13px;font-weight:500;margin:0 0 10px;color:var(--muted)}
 .predicta-topic-order .predicta-stake-entry .pl-field {gap:10px;margin:0 0 12px}
 .predicta-topic-order .predicta-stake-entry input {appearance:none;display:block;box-sizing:border-box;width:100%;height:76px;padding:18px;background:var(--surface-control);color:var(--text);font-size:30px;line-height:1.2;font-weight:650;border:0;border-radius:calc(10px*var(--pr,1))}
 .predicta-topic-order .predicta-stake-entry input::placeholder {font-size:16px;color:var(--muted);opacity:1}
 .predicta-topic-order .predicta-stake-shortcuts button {height:44px;background:var(--surface-control);font-size:14px;color:var(--text)}
 .predicta-topic-order .predicta-quote-note {margin:10px 0 26px;font-size:12.5px}
 .predicta-topic-order .predicta-stake-entry .pl-note {font-size:12.5px;margin-bottom:16px}
 .predicta-stake-footer {font-size:12.5px}
 .predicta-wallet-status {display:flex;align-items:center;gap:12px;justify-content:space-between;font-size:12.5px;color:var(--muted);line-height:1.6;margin:14px 0}
 .predicta-wallet-status button,.predicta-inline-action {flex:none;color:var(--text);text-decoration:none;text-underline-offset:4px;font-size:12.5px;min-height:36px}
 .predicta-topic-feedback {font-size:12.5px;color:var(--muted);line-height:1.7;margin:12px 0}
 @media(max-width:700px){
  .predicta-topic-dialog {width:100%;padding:0 18px max(20px,env(safe-area-inset-bottom))}
  .predicta-topic-layout {grid-template-columns:1fr;gap:24px}
  .predicta-topic-order {position:static;padding:20px}
  .predicta-topic-dialog .predicta-topic-title {font-size:22px;margin-bottom:20px}
  .predicta-order-heading {margin-bottom:20px}
 }
}
@scope (.px-market) {
 .predicta-recent-trend {display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap;font-size:10px;line-height:1.2;color:var(--muted)}
 .predicta-recent-trend svg {display:block;flex:none;width:72px;height:24px;overflow:visible}
 .predicta-recent-trend path {fill:none;stroke:var(--orange);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
 .predicta-trend-wait {font-size:10px;color:var(--muted);width:72px;text-align:center}
 .px-card-info {flex-wrap:wrap;row-gap:6px}
 .px-card-info time {flex-shrink:0}
}

@scope (.px-market) {
 @media(max-width:650px){
  .px-grid>.px-card .px-card-bottom {display:block;margin:auto 10px 10px;padding-top:8px}
  /* Let short mobile titles use their actual lines; the shared row still aligns odds. */
  .px-grid>.px-card .px-card-title {margin:10px;min-height:0;-webkit-line-clamp:4}
  .px-grid>.px-card .px-card-info {display:grid;gap:8px;margin:0 0 10px;justify-content:stretch}
  .px-grid>.px-card .px-card-info time {display:inline-flex;align-items:center;gap:4px;font-size:11.5px;white-space:normal;line-height:1.5}
  .px-grid>.px-card .predicta-recent-trend {justify-content:space-between;gap:4px;min-width:0}
  .px-grid>.px-card .predicta-recent-trend>span:first-child {font-size:10.5px}
  .px-grid>.px-card .predicta-recent-trend svg {width:58px;flex:none}
  .px-grid>.px-card .fc-market-control {gap:5px}
  .px-grid>.px-card .fc-market-option {padding:7px 4px;min-height:50px}
  .px-grid>.px-card .fc-market-content {flex-direction:column;gap:3px}
  .px-grid>.px-card .fc-odds {font-size:14px}
 }
}

/* Discovery uses the existing search surface and one representative per Event. */
@scope (.px-market) {
 .predicta-discovery .pl-title {align-items:center;margin-bottom:28px}
 .predicta-discovery .pl-title h1 {margin:0}
 .predicta-discovery-count {margin:8px 0 0;color:var(--muted);font-size:13px}
 .predicta-discovery-tools {margin-bottom:24px}
 .predicta-discovery-search {display:flex;align-items:center;gap:12px;max-width:520px;padding:0 16px;min-height:48px;border-radius:calc(10px*var(--pr,1));background:var(--surface-raised);color:var(--muted)}
 .predicta-discovery-search input {display:block;flex:1;min-width:0;width:100%;height:48px;padding:0;border:0;border-radius:0;background:transparent;color:var(--text);font:inherit;font-size:14px;outline:none}
 .predicta-discovery-search:focus-within {outline:2px solid var(--orange);outline-offset:3px}
 .predicta-discovery-search input::placeholder {color:var(--muted);opacity:1}
 .predicta-discovery-search input::-webkit-search-cancel-button {display:none}
 .predicta-discovery-search button {display:grid;place-items:center;width:28px;height:36px;flex:none;color:var(--muted);background:transparent}
 .predicta-discovery-tools .pl-tabs {margin:18px 0 0;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
 .predicta-discovery-tools .pl-tabs button {white-space:nowrap}
 @media(max-width:650px){
  .predicta-discovery .pl-title {gap:12px;margin-bottom:22px}
  .predicta-discovery .pl-title h1 {font-size:30px}
  .predicta-discovery .pl-title>.pl-btn {font-size:12px;padding:10px 12px}
  .predicta-discovery-search {max-width:none}
  .predicta-discovery-tools {margin-bottom:20px}
 }
}

/* Deadline text keeps the same neutral metadata color in every state. */
@scope (.px-market) {
 .predicta-deadline {font-variant-numeric:tabular-nums;white-space:nowrap}
 @media(max-width:650px){
  .px-grid>.px-card .px-card-info time:has(.predicta-deadline[data-mode="countdown"]),
  .px-grid>.px-card .px-card-info time:has(.predicta-deadline[data-mode="status"]) {display:inline-flex;align-items:center;justify-content:center;gap:4px;width:100%;font-size:11.5px;color:var(--muted)}
 }
}

/* A round refresh changes data in place; it must not resize/recreate every card. */
@scope (.px-market) {
 .predicta-card-market {display:grid;min-width:0;isolation:isolate}
 .predicta-card-market>div,.predicta-card-market>.px-empty-market {grid-area:1 / 1}
 .predicta-card-market .fc-market-control {width:100%}
 .predicta-card-market[data-show-control="false"]>.predicta-card-market-control,.predicta-card-market[data-show-control="false"]>.predicta-card-market-control * {visibility:hidden!important;pointer-events:none}
 .predicta-card-market[data-available="false"]>.predicta-card-market-control {pointer-events:none}
 .predicta-card-market[data-archived="true"] .fc-market-option:disabled {opacity:1;cursor:not-allowed}
 .predicta-card-market>.px-empty-market {display:flex;align-items:center;min-width:0;margin:0;padding:0;color:var(--muted);font-size:12.5px;line-height:1.5}
 @media(min-width:651px){
  .px-card-info time:has(.predicta-deadline) {min-inline-size:132px}
 }
}

/* Confirm sheet: a multiplier change updates the number in place (old value struck through), the sheet keeps its size */
.predicta-odds-live{display:inline-flex;align-items:baseline;gap:8px}
.predicta-odds-live s{color:var(--muted,var(--pc-8a827d,#8a827d));font-size:.86em;text-decoration-thickness:1px}
.predicta-odds-live[data-changed]>:last-child{animation:predicta-odds-in .5s ease-out}
@keyframes predicta-odds-in{from{color:var(--orange,var(--pc-ff7348,#ff7348))}to{color:inherit}}
@media(prefers-reduced-motion:reduce){.predicta-odds-live[data-changed]>:last-child{animation:none}}
/* Accepted: the action row turns into a drawn check while the sheet hands over to the detail page */
.predicta-flow-done{display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;color:var(--orange,var(--pc-ff7348,#ff7348));font-weight:600;animation:predicta-done-in .25s ease-out both}
.predicta-flow-done .success-mark{width:28px;height:28px;margin:0;color:inherit}
.predicta-flow-done .success-mark svg{width:28px;height:28px}
.predicta-flow-done .success-ring{fill:none}
@keyframes predicta-done-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
