/* Prediction surface -> focus -> depth. Kept isolated for reversible tuning. */

.prediction-card-edit {
  display: none !important;
}

.prediction-card.lod-uniform:not(.add-card) .prediction-depth-hint {
  position: absolute;
  right: 2px;
  bottom: -19px;
  display: block;
  color: rgba(205, 230, 244, 0);
  font: 650 9px/1 var(--mono);
  letter-spacing: .1em;
  opacity: 0;
  translate: 0 3px;
  pointer-events: none;
  transition: color 180ms ease, opacity 180ms ease, translate 180ms ease;
}

.prediction-card.lod-uniform.is-light-distant:not(.add-card) .prediction-title {
  color: rgba(182, 199, 211, .22) !important;
}

.prediction-card.lod-uniform.is-light-distant:not(.add-card) .lod-uniform-head {
  opacity: .4;
}

.prediction-card.lod-uniform.is-light-near:not(.add-card) .prediction-title {
  color: rgba(207, 220, 229, .56) !important;
}

.prediction-card.lod-uniform.is-light-primary:not(.add-card) .prediction-title {
  max-width: 100%;
  word-break: normal;
  text-wrap: wrap;
}

.prediction-card.lod-uniform.is-light-primary:not(.add-card) .prediction-depth-hint {
  color: rgba(192, 223, 241, .74);
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
  cursor: pointer;
}

.prediction-card.lod-uniform.is-light-primary:not(.add-card) .prediction-depth-hint:hover {
  color: rgba(224, 241, 251, .94);
  text-shadow: 0 0 10px rgba(130, 205, 252, .16);
}

.prediction-card.lod-uniform.is-depth-source:not(.add-card) {
  border-top-color: rgba(226, 244, 255, .72) !important;
  box-shadow:
    inset 0 1px 0 rgba(231, 248, 255, .18),
    0 0 28px rgba(130, 205, 252, .16) !important;
}

.crossroad-hero,
header,
.vfprep-signature {
  transition: filter 340ms ease, opacity 340ms ease, transform 340ms ease;
}

body.prediction-depth-open .crossroad-hero {
  filter: saturate(.42) brightness(.5) blur(1.4px);
  transform: scale(.994);
}

body.prediction-depth-open {
  overflow: hidden;
}

body.prediction-depth-compact::after {
  content: "";
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(1, 6, 11, .78);
  backdrop-filter: blur(5px) saturate(.55);
}

body.prediction-depth-open header,
body.prediction-depth-open .vfprep-signature {
  filter: saturate(.25) brightness(.42);
  opacity: .38;
}

.prediction-depth {
  position: fixed;
  inset: 21px;
  box-sizing: border-box;
  width: min(760px, calc(100vw - 48px));
  max-width: none;
  z-index: 1000;
  min-height: min(570px, calc(100svh - 70px));
  max-height: calc(100svh - 42px);
  overflow: auto;
  margin: auto;
  border: 1px solid rgba(130, 205, 252, .18);
  border-top-color: rgba(215, 240, 253, .48);
  padding: 0;
  background:
    radial-gradient(ellipse 70% 56% at 12% 0, rgba(78, 151, 192, .13), transparent 72%),
    linear-gradient(150deg, rgba(8, 20, 31, .99), rgba(2, 7, 12, .995) 64%);
  color: var(--text);
  box-shadow:
    0 38px 110px rgba(0, 0, 0, .74),
    0 0 44px rgba(67, 150, 199, .08),
    inset 1px 0 0 rgba(178, 224, 248, .14);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(.2, .72, .2, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(166, 207, 230, .3) transparent;
}

.prediction-depth::-webkit-scrollbar {
  width: 6px;
}

.prediction-depth::-webkit-scrollbar-track {
  background: transparent;
}

.prediction-depth::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: rgba(166, 207, 230, .26);
}

.prediction-depth::backdrop {
  background: rgba(1, 6, 11, .72);
  backdrop-filter: blur(5px) saturate(.55);
}

@starting-style {
  .prediction-depth[open] {
    opacity: 0;
    transform: translateY(22px) scale(.975);
  }
}

.prediction-depth-shell {
  position: relative;
  display: flex;
  min-height: inherit;
  flex-direction: column;
  padding: clamp(28px, 5vw, 58px) clamp(24px, 6vw, 68px) 34px;
}

.prediction-depth-shell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(190, 230, 251, .68) 23%, rgba(130, 205, 252, .12) 78%, transparent);
  box-shadow: 0 0 18px rgba(130, 205, 252, .18);
}

.prediction-depth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(205, 228, 241, .2);
  background: rgba(3, 9, 15, .46);
  color: rgba(224, 238, 247, .76);
  font: 300 24px/1 var(--mono);
  cursor: pointer;
}

.prediction-depth-close:hover,
.prediction-depth-close:focus-visible {
  border-color: rgba(225, 243, 253, .62);
  color: #fff;
  outline: none;
}

.prediction-depth-kicker {
  margin: 0 58px 22px 0;
  color: rgba(183, 219, 239, .62);
  font: 650 10px/1.3 var(--mono);
  letter-spacing: .22em;
}

.prediction-depth-title {
  max-width: 650px;
  margin: 0;
  color: rgba(239, 246, 250, .96);
  font-size: clamp(27px, 4.2vw, 43px);
  line-height: 1.38;
  letter-spacing: .025em;
}

.prediction-depth-lede {
  max-width: 610px;
  margin: 28px 0 0;
  color: rgba(173, 193, 207, .72);
  font-size: 16px;
  line-height: 2;
  letter-spacing: .055em;
  white-space: pre-wrap;
}

.prediction-depth-lede.is-empty {
  border-left: 1px solid rgba(150, 202, 231, .24);
  padding-left: 16px;
  color: rgba(151, 177, 193, .62);
  font-size: 14px;
}

.prediction-depth-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: auto 0 0;
  padding-top: 44px;
}

.prediction-depth-meta > div {
  min-height: 82px;
  border-top: 1px solid rgba(162, 205, 230, .13);
  padding: 14px 18px 10px 0;
}

.prediction-depth-meta dt {
  margin: 0 0 9px;
  color: rgba(149, 185, 207, .48);
  font: 650 9px/1 var(--mono);
  letter-spacing: .2em;
}

.prediction-depth-meta dd {
  margin: 0;
  color: rgba(221, 234, 242, .84);
  font: 560 15px/1.45 var(--mono);
  letter-spacing: .06em;
}

.prediction-depth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
}

.prediction-depth-actions button {
  min-height: 42px;
  border: 1px solid rgba(190, 220, 237, .18);
  background: transparent;
  color: rgba(192, 211, 223, .65);
  padding: 0 16px;
  font: 650 11px/1 var(--jp);
  letter-spacing: .1em;
  cursor: pointer;
}

.prediction-depth-actions button:hover,
.prediction-depth-actions button:focus-visible {
  border-color: rgba(225, 242, 252, .7);
  color: #fff;
  outline: none;
}

.prediction-depth-form[hidden] {
  display: none;
}

.prediction-depth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  margin: 24px 0 0;
  padding-top: 28px;
  border-top: 1px solid rgba(162, 205, 230, .16);
}

.prediction-depth-field {
  display: grid;
  gap: 9px;
  color: rgba(159, 194, 214, .62);
  font: 650 9px/1 var(--mono);
  letter-spacing: .18em;
}

.prediction-depth-field-wide {
  grid-column: 1 / -1;
}

.prediction-depth-field input,
.prediction-depth-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(180, 216, 236, .22);
  border-radius: 0;
  background: rgba(4, 11, 17, .72);
  padding: 10px 12px;
  color: rgba(237, 245, 249, .94);
  font: 560 15px/1.35 var(--jp);
  letter-spacing: .035em;
}

.prediction-depth-field textarea {
  min-height: 126px;
  resize: vertical;
  line-height: 1.75;
}

.prediction-depth-field input:focus,
.prediction-depth-field textarea:focus {
  border-color: rgba(216, 239, 251, .68);
  outline: none;
  box-shadow: 0 0 0 1px rgba(130, 205, 252, .12);
}

.prediction-depth-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.prediction-depth-form-actions button {
  min-height: 42px;
  border: 1px solid rgba(190, 220, 237, .22);
  background: transparent;
  padding: 0 18px;
  color: rgba(210, 226, 236, .78);
  font: 650 11px/1 var(--jp);
  cursor: pointer;
}

.prediction-depth-form-actions .prediction-depth-save {
  border-color: rgba(216, 239, 251, .56);
  background: rgba(210, 235, 248, .92);
  color: #07111a;
}

.prediction-depth-form-actions .prediction-depth-delete {
  margin-right: auto;
  border-color: rgba(210, 121, 121, .34);
  color: rgba(224, 166, 166, .82);
}

.prediction-depth-form-actions .prediction-depth-delete:hover,
.prediction-depth-form-actions .prediction-depth-delete:focus-visible {
  border-color: rgba(232, 146, 146, .7);
  background: rgba(125, 34, 34, .16);
  color: rgba(247, 201, 201, .96);
}

.prediction-depth.is-editing .prediction-depth-title,
.prediction-depth.is-editing .prediction-depth-lede,
.prediction-depth.is-editing .prediction-depth-meta,
.prediction-depth.is-editing .prediction-depth-actions {
  display: none;
}

@media (max-width: 760px) {
  .prediction-card.lod-uniform:not(.add-card) .prediction-depth-hint {
    right: 1px;
    bottom: -17px;
    font-size: 8px;
  }

  .prediction-depth {
    inset: 11px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
    margin: 0 !important;
  }

  .prediction-depth[data-compact-depth][open] {
    display: block;
  }

  .prediction-depth-shell {
    min-height: calc(100svh - 22px);
    padding: 24px 20px 18px;
  }

  .prediction-depth-kicker {
    margin-bottom: 18px;
  }

  .prediction-depth-title {
    font-size: clamp(24px, 7.2vw, 32px);
    line-height: 1.36;
  }

  .prediction-depth-lede {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.72;
  }

  .prediction-depth-meta {
    grid-template-columns: 1fr;
    margin: 26px 0 0;
    padding-top: 0;
  }

  .prediction-depth-form {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .prediction-depth-field-wide,
  .prediction-depth-form-actions {
    grid-column: 1;
  }

  .prediction-depth-meta > div {
    min-height: 54px;
    padding: 11px 12px 8px 0;
  }

  .prediction-depth-actions {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prediction-depth,
  .crossroad-hero,
  header,
  .vfprep-signature {
    transition: none !important;
  }
}

/* Edit in the finished composition instead of replacing it with a form. */
.prediction-depth-title-surface,
.prediction-depth-lede-surface {
  max-width: 650px;
}

.prediction-depth-lede-surface { max-width: 610px; }

.prediction-depth-title-editor,
.prediction-depth-lede-editor,
.prediction-depth-period-editor {
  display: none;
}

.prediction-depth-title-editor,
.prediction-depth-lede-editor {
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  resize: none;
  border: 0 !important;
  border-bottom: 1px solid rgba(150, 202, 231, .22) !important;
  border-radius: 0;
  background: transparent !important;
  padding: 0 0 5px;
  outline: none;
}

.prediction-depth-title-editor {
  min-height: 112px;
  color: rgba(239, 246, 250, .96) !important;
  font: 700 clamp(27px, 4.2vw, 43px)/1.38 var(--jp);
  letter-spacing: .025em;
}

.prediction-depth-lede-editor {
  min-height: 80px;
  margin-top: 28px;
  color: rgba(173, 193, 207, .78) !important;
  font: 500 16px/2 var(--jp);
  letter-spacing: .055em;
}

.prediction-depth-title-editor:focus,
.prediction-depth-lede-editor:focus {
  border-bottom-color: rgba(216, 239, 251, .7);
  outline: none !important;
  box-shadow: 0 8px 20px -18px rgba(130, 205, 252, .7);
}

.prediction-depth-period-editor {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.prediction-depth-period-editor input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 0 !important;
  border-bottom: 1px solid rgba(150, 202, 231, .22) !important;
  border-radius: 0;
  background: transparent !important;
  padding: 0 2px 4px 0;
  color: rgba(221, 234, 242, .9) !important;
  font: 560 14px/1.45 var(--mono);
  letter-spacing: .02em;
  color-scheme: dark;
}

/* Keep the editable date on the same visual row as the read-only WHEN value. */
.prediction-depth.cr-input-dialog .prediction-depth-period-editor input {
  min-height: 34px;
}

.prediction-depth-period-editor input:focus {
  border-bottom-color: rgba(216, 239, 251, .7);
  outline: none !important;
}

.prediction-depth-period-editor span {
  color: rgba(149, 185, 207, .5);
  font-family: var(--mono);
}

.prediction-depth.is-editing .prediction-depth-title,
.prediction-depth.is-editing .prediction-depth-lede,
.prediction-depth.is-editing .prediction-depth-when > dd,
.prediction-depth.is-editing .prediction-depth-actions {
  display: none;
}

.prediction-depth.is-editing .prediction-depth-title-editor,
.prediction-depth.is-editing .prediction-depth-lede-editor {
  display: block;
}

.prediction-depth.is-editing .prediction-depth-meta {
  display: grid;
}

.prediction-depth.is-editing .prediction-depth-period-editor {
  display: grid;
}

.prediction-depth.is-editing .prediction-depth-form {
  display: block;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.prediction-depth.is-editing .prediction-depth-form-actions {
  margin-top: 0;
}

@media (max-width: 760px) {
  .prediction-depth-title-editor {
    min-height: 88px;
    font-size: clamp(24px, 7.2vw, 32px);
    line-height: 1.36;
  }

  .prediction-depth-lede-editor {
    min-height: 64px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.72;
  }

  .prediction-depth-period-editor {
    gap: 5px;
  }

  .prediction-depth-period-editor input {
    font-size: 12px;
  }

  .prediction-depth.is-editing .prediction-depth-form {
    margin-top: 16px;
  }
}
