#quest-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(
    100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  padding: clamp(16px, 3vw, 28px);
  padding-top: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: #f1f5f7;
  background: #111e2b;
  border: 2px solid #718698;
  border-radius: 12px;
  box-shadow: 0 18px 65px #000b;
}
#quest-dialog::backdrop {
  background: #030a12bc;
}
.quest-board-heading,
.field-quest-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quest-board-heading h2 {
  margin: 0;
}
.quest-board-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 0;
  background: #111e2b;
}
#close-quests {
  min-height: 44px;
  min-width: 64px;
}
#quest-reward-target {
  color: #ffd17b;
  margin: 12px 0 20px;
}
#quest-dialog h3 {
  margin: 18px 0 12px;
  font-size: 16px;
}
#contract-list,
#quest-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.field-quest {
  min-width: 0;
  padding: 14px;
  border: 1px solid #43576a;
  background: #1d2d3d;
  border-radius: 6px;
}
.field-quest[data-ready="true"] {
  border-color: #f4ba53;
  background: #332e23;
}
.field-quest h4 {
  margin: 0;
  font-size: 15px;
}
.field-quest-heading {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.field-quest-heading span {
  font-size: 13px;
  color: #ced8df;
  font-variant-numeric: tabular-nums;
}
.field-quest progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 12px;
  accent-color: #eeb148;
}
.field-quest p {
  font-size: 12px;
  line-height: 1.5;
  color: #d2dce4;
  margin: 10px 0;
}
.field-quest button {
  min-height: 44px;
  width: 100%;
  padding: 8px;
  font-size: 14px;
}
.field-quest[data-ready="true"] button {
  color: #211709;
  background: #f5bd58;
  border-color: #ffe1a0;
}
@media (max-width: 520px) {
  #contract-list,
  #quest-list {
    grid-template-columns: 1fr;
  }
  .field-quest {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 14px;
  }
  .field-quest-heading,
  .field-quest progress,
  .field-quest p {
    grid-column: 1;
    margin: 0;
  }
  .field-quest button {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 100px;
    align-self: center;
  }
}
