.prediction-exchange-open {
  width: 46px;
  min-height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--prediction) 26%, transparent);
  background: rgba(5, 10, 17, .72);
  color: var(--prediction);
  padding: 6px 4px;
  cursor: pointer;
}

.prediction-exchange-open span { font-size: 18px; line-height: 1; }
.prediction-exchange-open b { font: 700 12px/1 var(--mono); letter-spacing: .06em; }
.prediction-exchange-open:hover,
.prediction-exchange-open:focus-visible { border-color: var(--prediction); outline: none; }

#prediction-home {
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.prediction-home-menu-progress {
  position: absolute;
  z-index: 2;
  left: 11px;
  right: 9px;
  bottom: -6px;
  height: 2px;
  overflow: hidden;
  background: color-mix(in srgb, var(--prediction) 18%, transparent);
  opacity: .72;
}

.prediction-home-menu-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  box-shadow: 0 0 11px color-mix(in srgb, var(--prediction) 62%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
}

#prediction-home.is-menu-arming {
  filter: drop-shadow(0 0 13px color-mix(in srgb, var(--prediction) 62%, transparent));
}

#prediction-home.is-menu-arming .prediction-home-menu-progress::after {
  transform: scaleX(1);
  transition: transform 1.2s linear;
}

@media (max-width: 760px), (pointer: coarse) {
  .prediction-home-menu-progress { display: none; }
}

.prediction-pack-source {
  display: inline-block;
  margin: 0 0 9px;
  color: #a89471;
  font: 700 12px/1 var(--mono);
  letter-spacing: .15em;
}

/* The exchange stays in the editor, but behaves as one shallow right-side layer. */
.prediction-exchange-inline {
  position: fixed;
  z-index: 260;
  inset: 0;
  width: auto;
  max-height: none;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  border: 0;
  background: rgba(1, 5, 9, .66);
  color: var(--text);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.prediction-exchange-inline[hidden] { display: none; }

.prediction-exchange-panel {
  width: min(520px, 100vw);
  height: 100svh;
  overflow-y: auto;
  box-sizing: border-box;
  border-left: 1px solid rgba(223, 229, 233, .2);
  background: linear-gradient(180deg, rgba(8, 15, 23, .995), rgba(3, 8, 14, .995));
  padding: 28px 26px 42px;
  box-shadow: -30px 0 90px rgba(0, 0, 0, .58);
  animation: predictionPackIn .32s cubic-bezier(.2, .75, .2, 1) both;
}

@keyframes predictionPackIn {
  from { opacity: .3; transform: translateX(54px); }
  to { opacity: 1; transform: none; }
}

.prediction-exchange-head {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: row;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.prediction-exchange-head p {
  margin: 0 0 8px;
  color: var(--prediction);
  font: 700 12px/1.2 var(--mono);
  letter-spacing: .2em;
}

.prediction-exchange-head h2 {
  margin: 0;
  color: var(--silver);
  font: 800 28px/1 var(--display);
  letter-spacing: .1em;
}

.prediction-exchange-close {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(220, 232, 239, .22);
  background: transparent;
  color: var(--silver);
  padding: 8px 11px;
  cursor: pointer;
}

.prediction-exchange-close span { font: 700 13px/1 var(--mono); letter-spacing: .08em; }
.prediction-exchange-close b { font: 400 17px/1 var(--display); }
.prediction-exchange-close:hover,
.prediction-exchange-close:focus-visible { border-color: var(--actual); outline: none; }

.prediction-exchange-intro {
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: .035em;
}

.prediction-exchange-grid { display: grid; gap: 12px; }
.prediction-exchange-group-label { display: none; }
.prediction-exchange-grid > section {
  border: 1px solid rgba(223, 229, 233, .13);
  background: rgba(255, 255, 255, .018);
  padding: 16px;
}

.prediction-exchange-export {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.prediction-exchange-export .prediction-pack-export { grid-column: 1 / -1; }
.exchange-section-kicker {
  margin: 0 0 6px;
  color: #8f7a59;
  font: 700 12px/1 var(--mono);
  letter-spacing: .14em;
}

.prediction-exchange-grid h3 {
  margin: 0;
  color: var(--silver);
  font: 700 18px/1.3 var(--mono);
  letter-spacing: .045em;
}

.exchange-section-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: .025em;
}

.prediction-exchange-import > .exchange-section-note { margin-bottom: 13px; }

.exchange-author {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px 8px;
  border-left: 2px solid var(--prediction);
  padding: 9px 10px;
  background: color-mix(in srgb, var(--prediction) 4%, transparent);
}

.exchange-author small {
  grid-column: 1 / -1;
  color: #78684e;
  font: 700 12px/1 var(--mono);
  letter-spacing: .12em;
}

.exchange-author strong { color: var(--prediction); font: 800 22px/1 var(--display); letter-spacing: .08em; }
.exchange-author span { color: #9b8a6e; font: 700 12px/1.2 var(--mono); letter-spacing: .04em; }

.prediction-pack-export,
.prediction-pack-choose,
.prediction-pack-last,
.prediction-pack-paste-toggle,
.prediction-pack-forget,
.prediction-pack-inspect,
.prediction-pack-merge {
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--prediction) 34%, transparent);
  background: transparent;
  color: var(--prediction);
  padding: 9px 11px;
  font: 700 13px/1.2 var(--mono);
  letter-spacing: .075em;
  cursor: pointer;
}

.prediction-pack-export:hover,
.prediction-pack-choose:hover,
.prediction-pack-last:hover,
.prediction-pack-paste-toggle:hover,
.prediction-pack-inspect:hover,
.prediction-pack-merge:hover,
.prediction-pack-export:focus-visible,
.prediction-pack-choose:focus-visible,
.prediction-pack-last:focus-visible,
.prediction-pack-paste-toggle:focus-visible,
.prediction-pack-inspect:focus-visible,
.prediction-pack-merge:focus-visible { border-color: var(--prediction); outline: none; }

.prediction-pack-source-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.prediction-pack-choose,
.prediction-pack-last,
.prediction-pack-paste-toggle { border-color: rgba(223, 229, 233, .18); color: #a7b1b8; }

.prediction-pack-forget {
  min-height: 0;
  display: block;
  margin: 10px 0 0 auto;
  border: 0;
  color: #6f7b84;
  padding: 4px 0;
  font-size: 12px;
}

.prediction-pack-paste-panel[hidden] { display: none; }
.prediction-pack-paste-panel { margin-top: 9px; }
.prediction-pack-json {
  width: 100%;
  min-height: 126px;
  box-sizing: border-box;
  border: 1px solid rgba(223, 229, 233, .15);
  background: rgba(0, 3, 6, .55);
  color: #aeb8bf;
  padding: 11px;
  resize: vertical;
  font: 600 13px/1.5 var(--mono);
  outline: none;
}

.prediction-pack-json:focus { border-color: color-mix(in srgb, var(--prediction) 56%, transparent); }
.prediction-pack-inspect { width: 100%; margin-top: 6px; }

.prediction-provider-block {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(223, 229, 233, .11);
  background: rgba(0, 3, 6, .32);
}

.prediction-provider-block[hidden] { display: none; }
.prediction-provider-title { display: block; color: #8f7a59; font: 700 12px/1 var(--mono); letter-spacing: .1em; }
.prediction-provider-note { margin: 8px 0 11px; color: #81909a; font: 600 13px/1.45 var(--mono); letter-spacing: .02em; }
.prediction-provider {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(223, 229, 233, .17);
  background: rgba(255, 255, 255, .025);
  color: var(--silver);
  padding: 7px 10px 7px 7px;
  text-align: left;
  cursor: pointer;
  transition: border-color .24s ease-out, background .24s ease-out, transform .24s ease-out;
}

.prediction-provider:hover,
.prediction-provider:focus-visible {
  border-color: color-mix(in srgb, var(--prediction) 62%, transparent);
  background: color-mix(in srgb, var(--prediction) 5%, transparent);
  outline: none;
  transform: translateX(2px);
}

.prediction-provider:disabled { opacity: .46; cursor: wait; transform: none; }
.prediction-provider-avatar {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(231, 236, 239, .42);
  border-radius: 50%;
  background: #d9e0e4;
  color: #07101a;
  font: 800 12px/1 var(--display);
}

.prediction-provider-avatar img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.76) contrast(1.06); }
.prediction-provider > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.prediction-provider strong { font: 800 16px/1 var(--display); letter-spacing: .07em; }
.prediction-provider small { overflow: hidden; color: #96a3ab; font: 700 12px/1.2 var(--mono); letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.prediction-provider b { color: var(--prediction); font: 400 17px/1 var(--display); }

.prediction-exchange-status {
  min-height: 18px;
  margin: 11px 0 0;
  color: #a8926f;
  font: 700 13px/1.45 var(--mono);
  letter-spacing: .04em;
}

.prediction-exchange-status.is-error { color: #ff8f7b; }
.prediction-pack-preview {
  margin-top: 11px;
  border: 1px solid rgba(223, 229, 233, .16);
  background: rgba(0, 3, 6, .46);
  padding: 14px;
}

.prediction-pack-preview-head { display: flex; justify-content: space-between; gap: 12px; }
.prediction-pack-preview-head div { display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; }
.prediction-pack-preview-head small { grid-column: 1 / -1; color: #84919a; font: 700 12px/1 var(--mono); letter-spacing: .1em; }
.prediction-pack-preview-head strong { color: var(--prediction); font: 800 16px/1 var(--display); letter-spacing: .08em; }
.prediction-pack-preview-head span,
.prediction-pack-preview-head em { color: #87949d; font: 600 12px/1.3 var(--mono); font-style: normal; letter-spacing: .04em; }
.prediction-pack-preview-head span:empty { display: none; }
.prediction-pack-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.prediction-pack-stats span { display: flex; justify-content: space-between; align-items: end; border: 1px solid rgba(223, 229, 233, .11); padding: 8px; }
.prediction-pack-stats small { color: #82909a; font: 700 12px/1 var(--mono); letter-spacing: .05em; }
.prediction-pack-stats strong { color: #c6ced3; font: 800 16px/1 var(--display); }
.prediction-pack-preview-details {
  margin: 12px 0;
  border-top: 1px solid rgba(223, 229, 233, .1);
  border-bottom: 1px solid rgba(223, 229, 233, .1);
}
.prediction-pack-preview-details > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 3px;
  color: #c6ced3;
  cursor: pointer;
}
.prediction-pack-preview-details > summary::marker { color: var(--prediction); }
.prediction-pack-preview-details > summary strong { font: 800 13px/1.35 var(--display); letter-spacing: .06em; }
.prediction-pack-preview-details > summary small { color: #89959e; font: 700 11px/1.35 var(--mono); letter-spacing: .04em; }
.prediction-pack-preview-list { list-style: none; margin: 0; padding: 0; }
.prediction-pack-preview-list li { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 9px; border-top: 1px solid rgba(223, 229, 233, .09); padding: 8px 3px; }
.prediction-pack-preview-list time,
.prediction-pack-preview-list small { color: #89959e; font: 700 12px/1.4 var(--mono); letter-spacing: .04em; }
.prediction-pack-preview-list span { color: #c1c9ce; font: 600 13px/1.4 var(--mono); }
.prediction-pack-merge { width: 100%; }
.prediction-pack-merge:disabled { opacity: .32; cursor: default; }

@media (max-width: 760px) {
  .prediction-exchange-panel { width: min(460px, 100vw); padding: 20px 14px 32px; }
  .prediction-exchange-head h2 { font-size: 24px; }
  .prediction-exchange-intro { margin: 14px 0 17px; }
  .prediction-exchange-export { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .prediction-pack-source-actions { grid-template-columns: 1fr; }
  .prediction-pack-stats { grid-template-columns: repeat(2, 1fr); }
  .prediction-pack-preview-head { flex-direction: column; }
  .prediction-pack-preview-list li { grid-template-columns: 76px minmax(0, 1fr); }
  .prediction-pack-preview-list small { grid-column: 2; }
}

@media (max-width: 430px) {
  .prediction-exchange-close span { display: none; }
  .prediction-exchange-close { width: 40px; justify-content: center; padding: 7px; }
  .prediction-exchange-export { grid-template-columns: 1fr; }
  .prediction-exchange-export .prediction-pack-export { grid-column: 1; }
  .exchange-author { grid-template-columns: auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .prediction-exchange-panel,
  .prediction-exchange-dialog *,
  .prediction-exchange-open { animation: none !important; transition: none !important; }
}

/* In the prediction editor, Pack operations stay on the current screen. */
.prediction-exchange-inline.is-editor-inline {
  position: static;
  z-index: auto;
  inset: auto;
  width: 100%;
  display: block;
  margin: 12px 0;
  background: transparent;
  overflow: visible;
  backdrop-filter: none;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-panel {
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  animation: predictionPackInlineIn .22s ease-out both;
}

@keyframes predictionPackInlineIn {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: none; }
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-head,
.prediction-exchange-inline.is-editor-inline .prediction-exchange-intro,
.prediction-exchange-inline.is-editor-inline .prediction-exchange-export > .exchange-author,
.prediction-exchange-inline.is-editor-inline .prediction-exchange-export > div,
.prediction-exchange-inline.is-editor-inline .prediction-exchange-import > h3,
.prediction-exchange-inline.is-editor-inline .prediction-exchange-import > .exchange-section-note {
  display: none;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-group-label {
  display: block;
  grid-column: 1 / -1;
  color: #8996a0;
  font: 700 13px/1 var(--mono);
  letter-spacing: .16em;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 2.2fr);
  gap: 10px;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-grid > section {
  border: 0;
  background: transparent;
  padding: 0;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-export {
  display: grid;
  grid-template-rows: auto 58px;
  gap: 8px;
  align-self: start;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-export {
  width: 100%;
  height: 58px;
  min-height: 58px;
  border-color: #dfe7ec;
  background: #dfe7ec;
  color: #08121b;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-import {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider-block {
  grid-column: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider-title,
.prediction-exchange-inline.is-editor-inline .prediction-provider-note {
  display: none;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider,
.prediction-exchange-inline.is-editor-inline .prediction-provider-list {
  height: 100%;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider {
  min-height: 58px;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-source-actions {
  display: contents;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-choose,
.prediction-exchange-inline.is-editor-inline .prediction-pack-paste-toggle {
  min-height: 58px;
  font-size: 14px;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-export {
  font-size: 14px;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider strong {
  font-size: 15px;
}

.prediction-exchange-inline.is-editor-inline .prediction-provider small {
  display: block;
  font-size: 10px;
  letter-spacing: .03em;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-paste-panel {
  grid-column: 1 / -1;
}

.prediction-exchange-inline.is-editor-inline .prediction-pack-paste-panel {
  margin-top: 0;
}

.prediction-exchange-inline.is-editor-inline .prediction-exchange-status,
.prediction-exchange-inline.is-editor-inline .prediction-pack-preview {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .prediction-exchange-inline.is-editor-inline .prediction-exchange-grid,
  .prediction-exchange-inline.is-editor-inline .prediction-exchange-import {
    grid-template-columns: 1fr;
  }

  .prediction-exchange-inline.is-editor-inline .prediction-pack-export,
  .prediction-exchange-inline.is-editor-inline .prediction-provider,
  .prediction-exchange-inline.is-editor-inline .prediction-pack-choose,
  .prediction-exchange-inline.is-editor-inline .prediction-pack-paste-toggle {
    min-height: 50px;
  }

  .prediction-exchange-inline.is-editor-inline .prediction-exchange-export {
    grid-template-rows: auto 50px;
  }
}
